Open
Conversation
cdc5eb5 to
e56ffcd
Compare
cedric-anne
requested changes
Jul 12, 2023
| 'remove_delete_watcher_group_btn' => 1, | ||
| 'remove_delete_assign_group_btn' => 0, | ||
| 'remove_delete_assign_supplier_btn' => 1, | ||
| 'use_filter_assign_group' => 1, |
Contributor
There was a problem hiding this comment.
It was 0 on previous code.
Suggested change
| 'use_filter_assign_group' => 1, | |
| 'use_filter_assign_group' => 0, |
Comment on lines
210
to
211
| $status = CommonITILObject::INCOMING.", ".CommonITILObject::PLANNED.", ". | ||
| CommonITILObject::ASSIGNED.", ".CommonITILObject::WAITING; |
Contributor
There was a problem hiding this comment.
This has to be converted into an array of values.
Suggested change
| $status = CommonITILObject::INCOMING.", ".CommonITILObject::PLANNED.", ". | |
| CommonITILObject::ASSIGNED.", ".CommonITILObject::WAITING; | |
| $status = [ | |
| CommonITILObject::INCOMING, | |
| CommonITILObject::PLANNED, | |
| CommonITILObject::ASSIGNED, | |
| CommonITILObject::WAITING, | |
| ]; |
| if (!$res = $DB->query($query_users)) { | ||
| $res = $DB->insert('glpi_tickets_user', new QuerySubQuery([ | ||
| 'SELECT' => [ | ||
| new QueryExpression("'' AS " . $DB::quoteName('id')), |
Contributor
There was a problem hiding this comment.
Suggested change
| new QueryExpression("'' AS " . $DB::quoteName('id')), | |
| new QueryExpression($DB::quoteValue('') . " AS " . $DB::quoteName('id')), |
| if (!$res = $DB->query($query_groups)) { | ||
| $res = $DB->insert('glpi_tickets_user', new QuerySubQuery([ | ||
| 'SELECT' => [ | ||
| new QueryExpression("'' AS " . $DB::quoteName('id')), |
Contributor
There was a problem hiding this comment.
Suggested change
| new QueryExpression("'' AS " . $DB::quoteName('id')), | |
| new QueryExpression($DB::quoteValue('') . " AS " . $DB::quoteName('id')), |
| if (! $res = $DB->query($query_docs)) { | ||
| $res = $DB->insert('glpi_documents_items', new QuerySubQuery([ | ||
| 'SELECT' => [ | ||
| new QueryExpression("'' AS " . $DB::quoteName('id')), |
Contributor
There was a problem hiding this comment.
Suggested change
| new QueryExpression("'' AS " . $DB::quoteName('id')), | |
| new QueryExpression($DB::quoteValue('') . " AS " . $DB::quoteName('id')), |
Comment on lines
+91
to
+92
| getEntitiesRestrictCriteria('glpi_groups', '', $entity, true, true) | ||
| ], |
Contributor
There was a problem hiding this comment.
We had an issue recently on treeview plugin with this because getEntitiesRestrictCriteria() can return an empty array. See pluginsGLPI/treeview#49.
Suggested change
| getEntitiesRestrictCriteria('glpi_groups', '', $entity, true, true) | |
| ], | |
| ] + getEntitiesRestrictCriteria('glpi_groups', '', $entity, true, true), |
|
|
||
| if ($filter) { | ||
| $query .= "AND ($filter)"; | ||
| $criteria['WHERE'][] = new QueryExpression($filter); |
Contributor
There was a problem hiding this comment.
Method is used only at 2 distinct places, please transform $filter into an array in order to also remove raw SQL in caller method.
Suggested change
| $criteria['WHERE'][] = new QueryExpression($filter); | |
| $criteria['WHERE'][] = $filter; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove raw SQL to improve future compatibility.
Requires glpi-project/glpi#14970 for
INSERT INTO ... SELECTsupport.