-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Fotorama gallery configuration fix #15546
Fotorama gallery configuration fix #15546
Conversation
…les. This check will prevent populating "false" value - default value will be used instead.
Hello @furseyev. The previous solution is not correct for sure. But in case of the current solution, a default value is never used. If there's no value for some var, it's always 'false', so no fallback to the default value. Correct me if I'm wrong, please. |
Hello @rogyar , |
Hello @furseyev. Thanks, I got your point. However, still have some doubts regarding the correct way. Expected behavior: Current behavior: So, basically, the scenario when we have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're missing commas off the end of all those additions causing invalid JSON error.
The gallery/navarrows
value is also missing it's key.
…arrows missing directive
@adamj88 , |
@furseyev worth noting as well, certain values can be different to true and false, for example: The option Would be worth cross referencing those against the full set of options as it is currently limiting them to true/false. |
Closing in favor of #16594 |
Description
Fotorama gallery configuration fix: Removing check for boolean variables. This check will prevent populating "false" value - default value will be used instead.
Previous code for boolean config looked like:
<?php if (($block->getVar("gallery/caption"))): ?> "showCaption": <?= /* @escapeNotVerified */ $block->getVar("gallery/caption") ?>, <?php endif; ?>
In this case if show caption option set to "false", we will simply won't get the condition body output, so fotorama will use a default configuration.
app/design/frontend/Magento/blank/etc/view.xml has:
<vars module="Magento_Catalog"> <var name="gallery"> <var name="caption">false</var> </var> </vars>
So the default value will be shown:
lib/web/fotorama/fotorama.js line 621:
showcaption: true,
Which means that image caption will be shown always, ignoring theme's configuration.
Manual testing scenarios