Support Forum

Undefined index error on iPads/Tablets

RY Ryan
Ryan
Member

Hi Guys,

Users on iPads are getting the following error appear on my website:

Notice: Undefined index: active in /problem-with-post-edit-buttonome/WEBSITE/public_html/wp-content/plugins/simple-press/sp-startup/site/sp-site-support-functions.php on line 484

The function that is throwing the error is:

function sp_get_current_sp_theme() {
 global $spDevice;

 if ($spDevice == 'mobile') {
 $theme = sp_get_option('sp_mobile_theme');
 if (!empty($theme) && $theme['active']) return $theme;
 }

 if ($spDevice == 'tablet') {
 $theme = sp_get_option('sp_tablet_theme');
 if (!empty($theme) && $theme['active']) return $theme;
 }

 return sp_get_option('sp_current_theme');
}

The actual line is two lines under the tablet if statement:

if (!empty($theme) && $theme['active']) return $theme;

My tablet theme support is empty so I don’t know why it’s going wrong see: http://i.imgur.com/C8Fb7hm.png

Thanks

3 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

Well it might be worth going into the mobile and tablet theme pages and at least setting them to the desktop theme which will result in stopping the notice being shown. Clearly – for some reason – the defaults have not saved on your DB.

But…. there is no way that you should allow Notices of this kind to be shown to your users on a production site. It just isn’t done. It means that error handling in your php.ini file on your server is not set up correctly for a live site and should be corrected as soon as you can. And that may, I assume, mean a strong word sent to your web host.

RY Ryan
Ryan
Member

Hi Yellow Swordfish,

I had set wp-config.php’s WP_DEBUG variable to true to see the error, they don’t normally see the error I made it appear for reporting purposes.

Thanks for the advise, I’ve set the the same as the main site.

YS Yellow Swordfish
Yellow Swordfish
Member

That’s good news. I am glad it is not reporting all those annoying notices to your users.