Seravo / seravo-plugin

Enhances WordPress with Seravo specific features and integrations
https://seravo.com/
GNU General Public License v2.0
38 stars 16 forks source link

Undefined variables and indexes when in production #43

Closed elguitar closed 7 years ago

elguitar commented 7 years ago

Following notices popped up when accessing dashboard:

Notice: Undefined variable: menuclass in /data/wordpress/htdocs/wp-content/mu-plugins/seravo-plugin/modules/instance-switcher.php on line 105
Notice: Undefined index: info in /data/wordpress/htdocs/wp-content/mu-plugins/seravo-plugin/modules/instance-switcher.php on line 116
Notice: Undefined index: name in /data/wordpress/htdocs/wp-content/mu-plugins/seravo-plugin/modules/instance-switcher.php on line 123
Notice: Undefined index: name in /data/wordpress/htdocs/wp-content/mu-plugins/seravo-plugin/modules/instance-switcher.php on line 124

The first notice happens, because the $menuclass is defined inside an if where getenv('WP_ENV') != 'production'. Could we define menuclass before the if? The index notices happen, because InstanceSwitcher::load_shadow_list() returns an array where the only instance is Production which doesn't have said properties. Is this api problem?

ottok commented 7 years ago

Fixed in 645c0dacd02f4318090848ebb681c04316cdff41