emoncms / emoncms-docker

Emoncms docker container(s)
GNU Affero General Public License v3.0
38 stars 54 forks source link

Modules/group/group_model.php missing in the Docker image ? #11

Closed nicoinn closed 6 years ago

nicoinn commented 6 years ago

Hi!

I'm getting the following errors while trying to edit or view dashboards.

Notice: Undefined index: groups in /var/www/html/Modules/graph/widget/graph_widget.php on line 21

Warning: Invalid argument supplied for foreach() in /var/www/html/Modules/graph/widget/graph_widget.php on line 21

I looked at the faulty piece of code

if (group_module_installed()) {
    require_once "Modules/group/group_model.php";
    $group = new Group($mysqli, null, null, null, null);
}
else
    $group = null;

.......

function group_module_installed() {
    global $mysqli;
    $result = $mysqli->query("SHOW TABLES LIKE 'groups'");
    if ($result->num_rows > 0)
        return true;
    else
        false;
}

Based on the content of my database, the query in group_module_installed() returns 0 rows and the function returns true. However, my image doesn't seem to have group_model.php anywhere, an error occurs and $group is not defined when used later on, causing the message.

Is it a bug or am I doing something wrong ? :-/

Note that the dashboard and widgets are working perfectly fine despite that error message!

TrystanLea commented 6 years ago

Thanks for spotting @nicoinn, should be fixed now https://github.com/emoncms/graph/commit/818ae9402b4f5014bb8f1940926162880c303a68

nicoinn commented 6 years ago

I'm still getting the error at line 22 now...

I was maybe a little too fast to conclude above.

nicoinn commented 6 years ago

Another attempt to fix the thing in: https://github.com/emoncms/graph/pull/14

glynhudson commented 6 years ago

Thanks, graph PR has been merged 👍