After installing the Module “Group” i got an error, when i displays the dashboard
Follow are the error
Warning: key_exists() expects parameter 2 to be array, null given in /var/www/vhosts/xxxx.com/xxx.xxxx.com/Modules/group/group_menu.php on line 7
The Warning are not showing at the Dashboard when you are logged-in.
Can you try updating and try again to see if the issue is still there and copy the “server information” from the admin page (there is button to copy all the data). We do not know what version emoncms you are using, but I can tell the groups module isn’t the latest as line 7 of group_menu.php is now in a comment block so it’s not clear which actual line is causing the issue.
You should update all the Modules as well as the core as sometimes changes are made to the core to allow certain modules to work.
Now i got the follow error when i not logged-in.
Warning: key_exists() expects parameter 2 to be array, null given in /var/www/vhosts/xxx.ch/yyy.xxx.ch/Modules/group/group_menu.php on line 21
Follow the Server information:
Server Information
Emoncms
Version
9.8.30 : 2018.05.08
Modules
Administration : Dashboard v1.2.0 : Dashboard v1.2.0 : EventProcesses : Feed : Graph v1.2.0 : group : Input : CoreProcess : Schedule : Time : User : Visualisation
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /var/www/vhosts/xxx.ch/yyy.xxx.ch/Modules/admin/admin_main_view.php on line 355
if (key_exists('previous_userid', $_SESSION) == true) {
and “key_exists() expects parameter 2 to be array” sounds reasonable enough, the “null given” sounds like something is missing, like the current session details.
After updating I assume you updaed the db from the admin page, did you also do a ctrl-f5 browser refresh?
@cagabi is the lead dev on the groups module, hopefully he or @TrystanLea might be able to shed some light on the matter.
I also notice you have another error reported in your “server information”, it says
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /var/www/vhosts/xxx.ch/yyy.xxx.ch/Modules/admin/admin_main_view.php on line 355.
and refers to this line
and possibly needs this bit changing from
while ( list($key, $val) = each($system['php_modules']) )
to something like
foreach( $system['php_modules'] as $key => $val )
but my PHP isn’t great so I shall wait for comments before doing a PR.
[edit] I decided to open an issue on github for the latter issue.
Thanks @gkobler for flagging the error and @pb66 for your help.
Because you are not logged in (you are using your apikey) there is no session for you in the server and that made $_SESSION to be null while when you are logged-in the session exists and $_SESSION is an array we use to store info (like permissions, your userid, etc)
I have fixed the problem, please update the group module and confirm here that everything is working ok by marking the post as Solved.