Skip to content

Add forwards compatibility for Contao 5.5 #41

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

Closed
wants to merge 3 commits into from

Conversation

zoglo
Copy link

@zoglo zoglo commented Mar 4, 2025

Description

This PR addresses the following three issues:

  • It disables turbo-prefetching for link operations, same as this PRaaaccf8.

  • Since we've switched to choices in Contao 5.5, the width: auto will completely shrink the select - 07628d4.

  • The MooRainbow picker was replaced in version 5.5. This PR adds backward compatibility, allowing the use of the contao-component. Since it's a direct dependency, it must be required, and the assets need to be loaded within your bundle.
    This will happen automatically if Contao > 5.5 is detected – a8c70c2.


Additional Information about using the old color picker

Please note that the color picker will only work in dark mode due to the new icon set, which uses two icons.
This is a known bug in the MooRainbow color picker, which is no longer used in Contao – contao/contao#7548.

Once this bundle no longer supports Contao 4.13 and 5.3, the color picker should be switched to the Stimulus component – contao/contao#7792.

@zonky2 zonky2 requested a review from stefanheimes March 7, 2025 14:02
@zonky2 zonky2 added the enhancement New feature or request label Mar 7, 2025
@zonky2 zonky2 added this to the 3.6.11 milestone Mar 7, 2025
@stefanheimes
Copy link
Member

stefanheimes commented Mar 28, 2025

I need some more time to review this. I'm not entirely happy with the current code base from MCW and I'll see if we can optimize it.

@zoglo
Copy link
Author

zoglo commented Mar 28, 2025

No worries

stefanheimes added a commit that referenced this pull request Mar 29, 2025
This PR addresses the following three issues:
- It disables turbo-prefetching for link operations
- Since Contao switched to choices in Contao 5.5, the width: auto
  will completely shrink the select
- The MooRainbow picker was replaced in version 5.5. This PR adds
  backward compatibility, allowing the use of the contao-component.
  Since it's a direct dependency, it must be required, and the assets
  need to be loaded within your bundle. This will happen automatically
  if Contao > 5.5 is detected
stefanheimes added a commit that referenced this pull request Mar 29, 2025
@stefanheimes
Copy link
Member

Thank you very much for the changes and suggestions @zoglo. I've created a new branch with my changes.

I've moved the JS and CSS inclusion for the ColorPicker into the event, so they are only loaded when actually needed. Additionally, I've adjusted function calls that already exist accordingly.

I will review the changes for Stimulus and see if I can integrate it. Most elements are provided with events to ensure compatibility with different Contao versions.

@zoglo
Copy link
Author

zoglo commented Apr 22, 2025

Superseded by #42

@zoglo zoglo closed this Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants