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 the order of the palette combiner #5271

Merged
merged 7 commits into from Sep 15, 2022

Conversation

ausi
Copy link
Member

@ausi ausi commented Sep 13, 2022

Currently having two selectors (palettes.__selector__) where one has the value foo and the other bar the palette foobar gets used as expected.

But if another selector appears before them in the __selector__ array that has a value of null, false or '' now the palett foo gets selected which is unexpected IMO.

This issue currently exists for example the tl_module.rocksolid_sliderrsts_default palette when installing madeyourday/contao-rocksolid-slider together with alnv/catalog-manager.

This PR solves this by skipping empty values when generating the palette names.

@ausi ausi added the bug label Sep 13, 2022
@ausi ausi added this to the 4.9 milestone Sep 13, 2022
@ausi ausi self-assigned this Sep 13, 2022
@ausi
Copy link
Member Author

ausi commented Sep 14, 2022

Looks like this issue was introduced by #5154 cc @dennisbohn

So an alternative fix would be to wrap the $sValues[] = $trigger; inside an if ($trigger)

@leofeyer
Copy link
Member

👍 for the alternative fix.

@dennisbohn
Copy link
Contributor

Thank you for fixing this.

@ausi ausi requested a review from leofeyer September 14, 2022 15:55
@leofeyer
Copy link
Member

The failing test seems to be related to the changes:

leofeyer
leofeyer previously approved these changes Sep 15, 2022
@leofeyer leofeyer force-pushed the fix/data-container-palette-combiner branch from 7dd1052 to 856201d Compare September 15, 2022 07:17
@leofeyer leofeyer enabled auto-merge (squash) September 15, 2022 11:54
@leofeyer
Copy link
Member

Thank you @ausi.

@leofeyer leofeyer merged commit f890056 into contao:4.9 Sep 15, 2022
@leofeyer leofeyer changed the title Fix order of palette combiner Fix the order of the palette combiner Sep 15, 2022
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.

None yet

4 participants