-
Notifications
You must be signed in to change notification settings - Fork 9.4k
[2.2] Reworked gallery.phtml and include unit tests #17920
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
Conversation
Updated code to output gallery variables. If items are not present in config, they are no longer output. (apart from gallery/nav and gallery/fullscreen/nav. gallery/nav now support false/thumbs/dots Updated all booleans to check type Confirmed output compliant with Magento docs. Left gallery/thumbmargin in, even though not in docs
Hi @gwharton. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
@magento-engcom-team give me test instance |
Hi @gwharton. Thank you for your request. I'm working on Magento instance for you |
Hi @gwharton, here is your new Magento instance. |
Hi @gwharton and @miguelbalparda yup looks like something was merged without the latest version of the file, it's easy to do if you are not keeping the branch up to date. If you are happy to continue @miguelbalparda then I would just go ahead and process this PR as normal. Sorry for the inconvenience. |
Hi Without changing getVar right now, this can be worked around just by removing the if statements, so always setting all properties in phtml. |
Yeah. I was never a fan of that update to getVar. I might look at it again. I may also look at moving the majority of the template code into a block function to facilitate unit testing. |
ok, on reflection, this is still a bit of a messy area. Please hold on this PR as I will be looking at this again and proposing further changes. |
… found. This is required now following the changes made in #12285 to allow the returning of boolean variable types from view.xml
… be generated by block function instead of inline in the template.
@tmotyl @miguelbalparda If everyone agrees that this is the best way forward, I will proceed and generate unit tests to cover all view.xml options. |
… unit tests of all gallery variables.
Infact, I'm still not happy with this at all. I really don't like the change that was made to the getVar function back in #12285 to return boolean in the case of true/false and strings for everything else. It's leading to all sorts of problems determining whether variables are valid or not, and having to deal with different return types, and variables with mixed types depending on values. I am going to revert that change, making it return false if the variable doesn't exist, or a string of the variable contents if it does exist. I will then implement an alternative fix for the original issue #12285. This will mean that all variables will be strings, and they can be typed appropriately by code in the gallery template and block functions when output as json. |
…rned as strings. This reverts changes made in #12285.
… Updated Options and Fullscreen Options functions.
…er does not convert any more.
@tmotyl @miguelbalparda OK, I think I have done just about as much as I would like to do on this one. To summarise what I have done.
Points to think about for the future
|
I think this is way to big to be merged all at once. How about dividing this into a couple of PRs? |
ok, understood. I will split the reversion of #12285 and the new resolution to that issue into a new PR and leave the rest in this one to see if that looks more manageable. |
Million thanks @gwharton! Feel free to assign the new PR to me and I'll give this a check. |
Description
This is dependent on PR #17969
Reworked gallery.phtml for gallery options and gallery fullscreen options.
Include unit tests
Fixed Issues (if relevant)
Although Issue #15009 is marked as fixed, the changes committed to fix the issue have gone missing!!! and do not appear in 2.2-develop. This fixes the issue again (albeit in a better way than before!)
Contribution checklist