Notice: Undefined index: order in /var/www/html/emoncms/Theme/basic/menu_view.php on line 97
I have built a couple of EmonCMS servers on Ubuntu Server 14.04 and I keep having the same problem with the menu. The menu is dropping down and obscuring things on the page below the menu. Above the menu are a couple of error notices:
Notice: Undefined index: order in /var/www/html/emoncms/Theme/basic/menu_view.php on line 97
Notice: Undefined index: order in /var/www/html/emoncms/Theme/basic/menu_view.php on line 97
These lines seem to be pushing the menu down a couple of lines. And you can't see these notices very well because the text is the same color as the background. You have to select the text and the highlight colors allow you to see the text.
I looked at the line # and file in question.
// Menu sort by order
function menu_sort($a,$b) {
return $a['order']>$b['order'];
}
I am not a PHP programmer but it seems that "order" has not been defined yet. Like most languages, you can't use a variable that has not been created yet.
So I am curious as to the problem here. Everything still seems to work but the menu is just messed up. It would be great to fix this so that the menu doesn't cover the top of the page.
I am attaching a screenshot.
Re: Notice: Undefined index: order
Check in all you non default modules in the file modulename_menu.php
You need to have the order parameter there, the value (10) can be any you want, like here in bold:
$menu_dropdown_config[] = array('name'=> dgettext($domain, "Inputs"), 'icon'=>'icon-signal', 'path'=>"input/view" , 'session'=>"write", 'order' => 10 );
Re: Notice: Undefined index: order
All of the modules have something similar there. So I figure that is not the problem or I am confused.
Re: Notice: Undefined index: order
@JRFeeney, which optional modules do you have installed on your system? not all the optional modules have been updated to have the order field needed in v9.0 yet.
Re: Notice: Undefined index: order
I do not believe I have any optional modules installed. I am currently just using what was installed using these instructions.
https://github.com/emoncms/emoncms/blob/9.0/docs/LinuxInstall.md
Re: Notice: Undefined index: order
On that page, in the "Install emoncms add-on modules" section, did you install any of those modules?
Paul
Re: Notice: Undefined index: order
Yes. I installed all of them. I didn't know they were optional. I figured the add-ons were necessary.
Re: Notice: Undefined index: order
I guess everyone is as confused as I am about this.
Re: Notice: Undefined index: order
@JRFeeney, If you added all extra Modules, please check the file notify_menu.php in the Notify Module, it is missing
HTH
Re: Notice: Undefined index: order
I updated this morning my emoncms 9.0 to version 9.2 and I'm getting this error now as well (not in 9.0). The only new module that was installed is the device module which has the order defined. Any idea how to resolve this issue ?
Re: Notice: Undefined index: order
It worked!!!
Since I am not a php programmer, it is not apparent to me where this goes.
, 'order' => 10
So I assumed that it went at the end of this array definition.
$menu_dropdown[] = array('name'=> dgettext($domain, _("Notify")), 'path'=>"notify" , 'session'=>"write", 'order' => 10);
Now I can see the rest of the page where the report buttons are.
Thanks!!!!