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: better inner join than comma for hook printFieldListFrom after #28681

Merged
merged 3 commits into from
Mar 7, 2024

Conversation

FHenry
Copy link
Member

@FHenry FHenry commented Mar 7, 2024

better to use INNER JOIN than comma and where for join

fix also regression because
$search_user = GETPOSTINT('search_user'); // this return 0
instead of
$search_user = GETPOST('search_user','int'); // this can return an empty string

in

$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx');

is $search_user=0 it will preselect current user connected but the filter in SQL is not apply, it's just display, so give false information about filtered lines

$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers((empty($search_user)?-2:0), 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx');

Will send -2 if not set

@eldy eldy merged commit 4fcbdf1 into Dolibarr:develop Mar 7, 2024
5 of 6 checks passed
@FHenry FHenry deleted the dev_updateSQL branch March 15, 2024 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants