Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
fix(widget): correct the query using user's the custom view's locked …
Browse files Browse the repository at this point in the history
…parameter
  • Loading branch information
sc979 committed Apr 11, 2019
1 parent 760e4e1 commit 43b85e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions www/class/centreonCustomView.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -661,14 +661,14 @@ public function addPublicViewWidgetParams($viewId, $userId)
$stmt = $this->db->prepare(
'SELECT * FROM widget_views wv ' .
'LEFT JOIN widget_preferences wp ON wp.widget_view_id = wv.widget_view_id ' .
'LEFT JOIN custom_view_user_relation cvur ON cvur.custom_view_id=wv.custom_view_id ' .
'WHERE cvur.custom_view_id = :viewId and cvur.locked = 0'
'LEFT JOIN custom_view_user_relation cvur ON cvur.custom_view_id = wv.custom_view_id ' .
'WHERE cvur.custom_view_id = :view_id AND cvur.is_owner = 1 AND cvur.user_id = wp.user_id'
);
$stmt->bindParam(':viewId', $viewId, PDO::PARAM_INT);
$dbResult = $stmt->execute();
if (!$dbResult) {
throw new \Exception(
"An error occurred when retrieving user's Id : " . userId .
"An error occurred when retrieving user's Id : " . $userId .
" parameters of the widgets from the view: Id = " . $viewId
);
}
Expand Down

0 comments on commit 43b85e4

Please sign in to comment.