{"action":"opened","issue":{"url":"https://api.github.com/repos/centreon/centreon/issues/4022","labels_url":"https://api.github.com/repos/centreon/centreon/issues/4022/labels{/name}","comments_url":"https://api.github.com/repos/centreon/centreon/issues/4022/comments","events_url":"https://api.github.com/repos/centreon/centreon/issues/4022/events","html_url":"https://github.com/centreon/centreon/issues/4022","id":123272160,"number":4022,"title":"Graph monitoring widget error","user":{"login":"albundy83","id":1215213,"avatar_url":"https://avatars.githubusercontent.com/u/1215213?v=3","gravatar_id":"","url":"https://api.github.com/users/albundy83","html_url":"https://github.com/albundy83","followers_url":"https://api.github.com/users/albundy83/followers","following_url":"https://api.github.com/users/albundy83/following{/other_user}","gists_url":"https://api.github.com/users/albundy83/gists{/gist_id}","starred_url":"https://api.github.com/users/albundy83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albundy83/subscriptions","organizations_url":"https://api.github.com/users/albundy83/orgs","repos_url":"https://api.github.com/users/albundy83/repos","events_url":"https://api.github.com/users/albundy83/events{/privacy}","received_events_url":"https://api.github.com/users/albundy83/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-21T12:37:32Z","updated_at":"2015-12-21T12:37:32Z","closed_at":null,"body":"Hello,\r\n\r\nthis is a post I have made on centreon forum, but maybe it has his place here : \r\nhttp://forum.centreon.com/forum/centreon-ui/centreon-web-interface/140149-centreon-web-2-7-0-and-graph-monitoring-widget\r\nWhen I have upgraded to Centreon 2.7, graph monitoring widgets are not working any more.\r\nI had to modify a php file (/$CENTREON/www/class/centreonGMT.class.php) to make it work again by adding this : \r\n```php\r\n    if (!isset($sid)) {\r\n        return 0;\r\n    }\r\n```\r\n\r\nHere the function before and after : \r\n```php\r\nfunction getMyGTMFromUser($userId, $DB = null)\r\n{\r\n    global $pearDB;\r\n\r\n    if (!isset($pearDB) && isset($DB)) {\r\n        $pearDB = $DB;\r\n    }\r\n\r\n    $DBRESULT = $pearDB->query(\"SELECT `contact_location` FROM `contact` \" .\r\n            \"WHERE `contact`.`contact_id` = \" . $userId .\r\n            \" LIMIT 1\");\r\n    if (PEAR::isError($DBRESULT)) {\r\n        $this->myGMT = 0;\r\n    }\r\n    $info = $DBRESULT->fetchRow();\r\n    $DBRESULT->free();\r\n    $this->myGMT = $info[\"contact_location\"];\r\n}\r\n```\r\nAnd the fixed one :\r\n```php\r\nfunction getMyGTMFromUser($userId, $DB = null)\r\n{\r\n    global $pearDB;\r\n\r\n    if (!isset($pearDB) && isset($DB)) {\r\n        $pearDB = $DB;\r\n    }\r\n\r\n    if (!isset($sid)) {\r\n        return 0;\r\n    }\r\n\r\n    $DBRESULT = $pearDB->query(\"SELECT `contact_location` FROM `contact` \" .\r\n            \"WHERE `contact`.`contact_id` = \" . $userId .\r\n            \" LIMIT 1\");\r\n    if (PEAR::isError($DBRESULT)) {\r\n        $this->myGMT = 0;\r\n    }\r\n    $info = $DBRESULT->fetchRow();\r\n    $DBRESULT->free();\r\n    $this->myGMT = $info[\"contact_location\"];\r\n}\r\n```"}}