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

Backend DCA filter dropdown/select options overwritten - can't have 2 options with the same label #1727

Closed
rhymeadam opened this issue Jul 24, 2023 · 1 comment

Comments

@rhymeadam
Copy link
Contributor

Hi all, I'm running into an issue where a DCA filter of mine is based on a field with a foreign key to tl_member. I noticed that if 2 or more of the members have the exact same first and last name, the code overwrites the first occurences with the last option. I adjusted this line of code to include the $kk variable and it seems to work as intended.

$options_sorter[$option_label . '_' . $field . '_' . $kk] = ' <option value="' . StringUtil::specialchars($value) . '"' . ((isset($session['filter'][$filter][$field]) && $value == $session['filter'][$filter][$field]) ? ' selected="selected"' : '') . '>' . StringUtil::specialchars($option_label) . '</option>';

$options_sorter[$option_label . '_' . $field] = ' <option value="' . StringUtil::specialchars($value) . '"' . ((isset($session['filter'][$filter][$field]) && $value == $session['filter'][$filter][$field]) ? ' selected="selected"' : '') . '>' . StringUtil::specialchars($option_label) . '</option>';

@github-actions
Copy link

Thank you for your contribution.

Unfortunately, you have created your issue in the wrong repository, as this is a read-only split repository. Please go to https://github.com/contao/contao and create your issue there.

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

No branches or pull requests

1 participant