johnstray / gs-blog

A simple and easy to use, yet powerful blog for GetSimple. With this plugin, you can create blog posts, sort posts by category, view posts in monthly archives, plus much more.
https://johnstray.com/gs-plugin/gs-blog/
GNU General Public License v3.0
6 stars 9 forks source link

php error in Custom Fields Manager #138

Closed pigsound closed 6 years ago

pigsound commented 6 years ago

Expected behaviour

show settings form

Actual behaviour

blank; debugger reports: "Fatal error: Uncaught Error: Cannot use string offset as an array in C:\MAMP\htdocs\directory\plugins\gs-blog\class\customFields.php:25 Stack trace: #0 C:\MAMP\htdocs\directory\plugins\gs-blog\inc\manage_custom_fields.php(10): customFields->getCustomFields() -1 C:\MAMP\htdocs\directory\plugins\gs-blog\inc\adminFunctions.php(89): show_custom_fields() -2 C:\MAMP\htdocs\directory\admin\load.php(39): blog_admin_controller() -3 {main} thrown in C:\MAMP\htdocs\directory\plugins\gs-blog\class\customFields.php on line 25"

Steps to reproduce the behaviour

johnstray commented 6 years ago

This appears to be a compatibility issue with PHP 7 as far as I can tell.

This class has never been modified by me before, but I will investigate was to update it for compatibility.

webservsol commented 6 years ago

$cf = array('options' => array(), 'main' => array()); Line 17 will solve the issue

johnstray commented 6 years ago

Thanks @webservsol. That worked perfectly to fix the error.