Skip to content

Redesign carousel implementation to reflect documentation - bug fix#44488

Merged
rdeutz merged 10 commits intojoomla:5.2-devfrom
iteidrm:patch-1
Feb 26, 2025
Merged

Redesign carousel implementation to reflect documentation - bug fix#44488
rdeutz merged 10 commits intojoomla:5.2-devfrom
iteidrm:patch-1

Conversation

@iteidrm
Copy link
Contributor

@iteidrm iteidrm commented Nov 20, 2024

Summary of Changes

This pull request fixes a bug in the Bootstrap Caraousel implementation of Joomla! (PHP and ES/JS) that causes valid parameters to be removed from the JavaScript options object that is fed to the Carousel instance. It replaces #38930.

Testing Instructions

I (still) do not know if the Patch Tester extension will do the JavaScript re-build / pre-processing for you, and hope you know best what to do in this regard. In any case, I've attached not only a demo / test module but also the changed files.

  • Activate the debug mode in the global configuration to better be able to inspect the generated JavaScript option object in the source code (Browser: Ctrl + U).
  • Install, activate and publish the demo module provided with the pull request on a module position of your choice (e.g. Cassiopeia: main-top). Make sure to set the Menu / Module Assignent to "On all pages".
  • Open / refresh the page and change some params in the module manager (e.g. keyboard | wrap to false).

Actual result BEFORE applying this Pull Request

All options set to false are filtered out, causing the carousel to fall back to its default values (not sliding).

Expected result AFTER applying this Pull Request

Params that can have a false value are recognised and the carousel works as expected.

Link to documentations

@Quy Please let me know if I have missed anything. Also, the problem with filtered parameters may not only exist in the carousel implementation, but in any other Bootstrap component where "false" is a valid option and array_filter is used in the corresponding helper method.

mod_bs_carousel.zip
patched_files.zip

Remove the re-setting of the options, as it is already done in the PHP helper as well as in the bootstrap library itself.
Refactor parameter handling to fix unwanted filtering of valid options.
The ride option can not only be set to "false" or "carousel" but also to "true".
@joomla-cms-bot joomla-cms-bot added NPM Resource Changed This Pull Request can't be tested by Patchtester PR-5.2-dev labels Nov 20, 2024
@ghost
Copy link

ghost commented Nov 20, 2024

I (still) do not know if the Patch Tester extension will do the JavaScript re-build / pre-processing for you, and hope you know best what to do in this regard.

The Pull Request have the Label NPM Resource Changed; hovering the Label give This Pull Request can't be tested by Patchtester.

@iteidrm
Copy link
Contributor Author

iteidrm commented Nov 20, 2024

The Pull Request have the Label NPM Resource Changed; hovering the Label give This Pull Request can't be tested by Patchtester.

@fgsw thanks for the clarification.

@richard67
Copy link
Member

People can download a package created by Drone, or update to that package using a custom URL. Both can be found by following the "Details" link at the right side of the "Download" step in the CI checks at the bottom of this PR.

@Quy
Copy link
Contributor

Quy commented Nov 25, 2024

I have tested this item ✅ successfully on d6fe622

Thank you so much for the updated PR/demo file! Great observation with array_filter. Hope to see more contributions from you.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44488.

@Hackwar Hackwar added the bug label Jan 17, 2025
@ceford
Copy link
Contributor

ceford commented Feb 5, 2025

I have tested this item ✅ successfully on bfca268

I can fix the documentation if you like.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44488.

@richard67
Copy link
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44488.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Feb 5, 2025
@richard67
Copy link
Member

I can fix the documentation if you like.

@ceford That would be great. But you should wait until this PR is merged and released.

@ceford
Copy link
Contributor

ceford commented Feb 5, 2025

I jumped the gun and updated the documentation!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44488.

@rdeutz rdeutz merged commit eb1fed9 into joomla:5.2-dev Feb 26, 2025
3 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Feb 26, 2025
@QuyTon QuyTon added this to the Joomla! 5.2.5 milestone Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug NPM Resource Changed This Pull Request can't be tested by Patchtester

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants