8000 Handle grouped options in the DCA filter by leofeyer · Pull Request #8312 · contao/contao · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Handle grouped options in the DCA filter #8312

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

Draft
wants to merge 1 commit into
base: 5.3
Choose a base branch
from

Conversation

leofeyer
Copy link
Member

Fixes #7409

@leofeyer leofeyer added the bug label Apr 28, 2025
@leofeyer leofeyer added this to the 5.3 milestone Apr 28, 2025
@leofeyer leofeyer requested a review from fritzmg April 28, 2025 11:40
@leofeyer leofeyer self-assigned this Apr 28, 2025
@leofeyer leofeyer linked an issue Apr 28, 2025 that may be closed by this pull request
@leofeyer
Copy link
Member Author

Although this only works with your particular case:

'options' => [
    'Lorem' => [
        'ipsum' => 'Dolor',
        // …
    ],
    // …
],

If the option value happens to be the same as the group title, the code would fail:

```php
'options' => [
    'ipsum' => [
        'ipsum' => 'Dolor',
        // …
    ],
    // …
],

@leofeyer leofeyer requested a review from ausi April 28, 2025 13:13
@fritzmg
Copy link
Contributor
fritzmg commented Apr 28, 2025

Hm, I see. Though I would consider it rare that a group label is ever the same as any of the values.

else
{
// Handle grouped options (see #7409)
$current = current($GLOBALS['TL_DCA'][$this->strTable]['fields'][$field]['options']);
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this would work. Wouldn't we need to go through all groups to find a matching option?

Copy link
Member Author

Choose a reason for hiding this comment

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

Of course 🤦‍♂️

@leofeyer leofeyer marked this pull request as draft May 2, 2025 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filter for grouped options does not show label
3 participants
0