infinum / eightshift-forms

WordPress plugin project for Gutenberg forms
https://eightshift.com
Other
29 stars 5 forks source link

Undefined class constant 'SIDEBAR_SORT_ORDER' #270

Closed JerrySpecter closed 1 year ago

JerrySpecter commented 1 year ago

Describe your bug

Hey,

Installed latest version of Eightshift Forms plugin > 2.0.0 and the forms UI works but when i got to the Settings page i get an Error:

Undefined class constant 'SIDEBAR_SORT_ORDER' in .../eightshift-forms/src/Blocks/components/admin-settings/partials/sidebar-section.php on line 25

Tried manually replacing variable with the array of strings and then it worked but all the items in the sidebar were "General".

I installed the plugin with git clone > composer install > npm install > npm run build and then i tried to download release.zip and the same error happened.

Steps to Reproduce

  1. Install the plugin
  2. Go to the settings page
  3. There should be an error

Expected behavior

Settings page should open with no errors? On previous release it was working okay for me.

Screenshots, screen recording, code snippet

image

Environment info

Please confirm that you have searched existing issues in this repo.

Yes

Please confirm that you have searched in our documentation and couldn't find the answer.

Yes

Please confirm that your bug occurs with all plugins uninstalled and with the default WordPress theme active.

Yes

mbmjertan commented 1 year ago

I can't reproduce this with the 2.0.0 release. The problematic class constant also seems to be defined in the class: https://github.com/infinum/eightshift-forms/blob/develop/src/Settings/Settings/SettingsAll.php#L55-L60

Screenshot 2022-10-11 at 09 20 07

Maybe this is an autoloading issue, so a few quick questions:

JerrySpecter commented 1 year ago

It's a basic setup, WP with boilerplate theme. Single plugin, single Eightshift libs

here is the entire stack:

image

Stack trace:
#0 /Users/karlobiscan/Sites/themelia/wp-content/plugins/eightshift-forms/vendor/infinum/eightshift-libs/src/Helpers/Components.php(206): require()
#1 /Users/karlobiscan/Sites/themelia/wp-content/plugins/eightshift-forms/src/Blocks/components/admin-settings/admin-settings.php(60): EightshiftFormsVendor\EightshiftLibs\Helpers\Components::renderPartial('component', 'admin-settings', 'sidebar-section...', Array)
#2 /Users/karlobiscan/Sites/themelia/wp-content/plugins/eightshift-forms/vendor/infinum/eightshift-libs/src/Helpers/Components.php(138): require('/Users/karlobis...')
#3 /Users/karlobiscan/Sites/themelia/wp-content/plugins/eightshift-forms/src/AdminMenus/FormGlobalSettingsAdminSubMenu.php(157): EightshiftFormsVendor\EightshiftLibs\Helpers\Components::render('admin-settings', Array)
#4 /Users/ in /Users/karlobiscan/Sites/themelia/wp-content/plugins/eightshift-forms/src/Blocks/components/admin-settings/partials/sidebar-section.php on line 25
[10-Oct-2022 20:34:44 UTC] PHP Fatal error:  Uncaught Error: Undefined class constant 'SIDEBAR_SORT_ORDER' in /Users/karlobiscan/Sites/themelia/wp-content/plugins/eightshift-forms/src/Blocks/components/admin-settings/partials/sidebar-section.php:25
JerrySpecter commented 1 year ago

When i install a fresh WP and add the plugin with Twentytwentytwo theme, it works okay, then i add the boilerplate to that setup and everything works okay. So the problem is somewhere in my setup. I'm closing this issue