GetSimpleCMS-CE-plugins / plugin-i18n-Special-Pages

Added php8.x support
0 stars 2 forks source link

http 500 error #1

Closed VeNick-GS closed 11 months ago

VeNick-GS commented 11 months ago

Hi @risingisland

I have a problem with this plugin on PHP8.2.12. When I create new special page I get a http 500 error in the admin. Error is: Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /home/.../htdocs/plugins/i18n_specialpages/backend.class.php:134 Stack trace: #0 /home/...8/htdocs/plugins/i18n_specialpages.php(262): I18nSpecialPagesBackend::save() #1 /home/.../htdocs/admin/inc/plugin_functions.php(293): i18n_specialpages_save() #2 /home/.../htdocs/admin/changedata.php(179): exec_action('changedata-save') #3 {main} thrown in /home/.../htdocs/plugins/i18n_specialpages/backend.class.php on line 134

What can be the probleme here? Thanks!

risingisland commented 11 months ago

Good question. Let me see if I can look at this soon and get back to you.

multicolor-rgb commented 11 months ago

@VeNickov are you use version from CE?

VeNick-GS commented 11 months ago

HI @multicolor-rgb Yes, I have installed version 3.3.19 CE from https://getsimplecms-ce.github.io/

multicolor-rgb commented 11 months ago

Yes, but looks like you are used version from https://getsimplecms-ce-plugins.github.io/? your error looks like you use from normal repo from GS CMS

risingisland commented 11 months ago

@VeNickov Could you try the following: Edit line 134 in /i18n_specialpages/backend.class.php to the following: if (count((array)@$def['fields']) > 0) foreach ($def['fields'] as $field) { To see if that does anything?

VeNick-GS commented 11 months ago

@risingisland Line 134 was edited as mentioned. It works now! Thank you!

risingisland commented 11 months ago

Thats great to hear. I will update the plugin this weekend. Thanks for testing this.