Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
746 views
in Plugins by
recategorized by

The following appears at the top of every page:

Notice: Undefined index: theme_switch in /home/[pathtoquestion2answer]/q2a/qa-include/qa-app-format.php(1265) : eval()'d code on line 26

The plugin works--mobile theme displays properly on devices--but, with that line at the top of the screen (in every theme).

It appears whether or not I check anything in the plugin options--simply placing the plugin files in the directory results in the error. If I remove them, the error disappears.

1 Answer

0 votes
by

This is going to keep haunting me... tell me - what is it that makes you think the above notice is an error?

It's a notice.  It's letting you know the index doesn't exist, and it isn't affecting the function in any way (it'll just return a null value for that index).  These notices should be turned off on production sites.  That is the best answer; I'll fix it so this doesn't show, but that doesn't close the security hole opened by showing these notices.

Yeah, it means I've got sloppy code, I know; but it works :)

If you update the plugin, this should disappear - but do turn off display of these notices!

by
Sorry! I thought it was an error because it did something I didn't like... :)

Can anyone tell me how to turn off the notice? Sounds very reasonable but I don't know how to do it...
by
you need to edit php.ini and change "display_errors = On" to "display_errors = Off".  If you can't access the main php.ini, put one in your home directory and add "display_errors = Off" to it, I think that works.
...