PHP Notice: Undefined property: stdClass::$options
-
I am developer in a project that uses WordPress for its blog. Photo Gallery plugin is used in it. A few days ago I updated WordPress and all used plugins, including Photo Gallery. I did that for a production and local development environment. Current version of plugin is 1.5.29. After the update a PHP Notice has started to show in PHP logs only on production:
PHP Notice: Undefined property: stdClass::$options in /var/www/uchase/public_html/motiviramse/wp-content/plugins/photo-gallery/framework/WD_BWG_Theme.php on line 1071
I check it and found out that business logic is expecting a $row object that is extracted from database table bwg_theme to have a property options. Properties of $row are formed from columns on bwg_theme table.
In production the table bwg_theme does not have column options, but many columns every one containing single option.
On local environment the table has a column options and all theme settings are saved in it as json.
On local environment I have uninstalled the plugin (all tables in database related to plugin have been removed) and added it again. I checked the database and saw there is options field in bwg_theme table. So I assumed this is the correct state of database. I do not understand how on production table ended up with different structure.
I do not want to uninstall the plugin in production because I will lost current galleries. What should I do to prevent this PHP Notice and to not lost my galleries?
- The topic ‘PHP Notice: Undefined property: stdClass::$options’ is closed to new replies.