Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX missing entity filter to customize ticket dictionaries by entity #26001

Merged
merged 3 commits into from
Sep 26, 2023

Conversation

hregis
Copy link
Contributor

@hregis hregis commented Sep 23, 2023

FIX add field "entity" only in $tabfieldinsert

@@ -1242,7 +1242,8 @@ public function loadCacheTypesTickets()

$sql = "SELECT rowid, code, label, use_default, pos, description";
$sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_type";
$sql .= " WHERE active > 0";
$sql .= " WHERE entity = ".getEntity('c_ticket_type');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With getEntity in a SQL, you must use
...entity IN (".getEntity().")"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eldy not for dictionary table, getEntity return 1 if all entities use the same dictionary or the current entity if the dictionary is personalized

Copy link
Member

@eldy eldy Sep 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So even in this case, we can use the IN.
For a more uniform code, it should be better to have IN everywhere for getEntity, even if at execution the in become a IN (1)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eldy ok it's fixed

@eldy eldy added the PR to fix - See feedback in comments PR needs to be fixed to be integrated (some comments should describes the fix to do) label Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR to fix - See feedback in comments PR needs to be fixed to be integrated (some comments should describes the fix to do)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants