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

Conditional variables don't work for {% extends %} tag when Blitz Hints utility is enabled #632

Closed
nikolenko-dmitriy opened this issue Mar 11, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@nikolenko-dmitriy
Copy link

nikolenko-dmitriy commented Mar 11, 2024

Bug Report

Tested in 2 different cases:

  1. Setting the custom variable to define the correct layout to extend. Below is a simple example:
{% set isJson = true %}

{% extends isJson ? '_layouts/ajax' : '_layouts/content' %}

Page fails with error Variable "isJson" does not exist.

  1. Using the default craft global variable currentUser:
{% extends not currentUser ? '_layouts/content' : '_layouts/content_with_sidebar' %}

Page fails with error Variable "currentUser" does not exist.

Note: the same examples work fine when Blitz setting hintsEnabled set to false.

Website uses some other important plugins:

  • Craft Commerce v 4.5.2
  • Sprig v 2.7.3
  • Blitz v 4.13.0. Also tested with v 4.12.0, v 4.11.0, v 4.10.0 and v 4.9.3, the result is the same

Plugin Version

4.13.0

Craft CMS Version

4.8.1

PHP Version

8.1.27

@nikolenko-dmitriy nikolenko-dmitriy added the bug Something isn't working label Mar 11, 2024
@bencroker
Copy link
Collaborator

I’m unable to replicate this using Blitz 4.13.0 on Craft 4.8.1. Can you show me the full stack trace of the error?

@nikolenko-dmitriy
Copy link
Author

I’m unable to replicate this using Blitz 4.13.0 on Craft 4.8.1. Can you show me the full stack trace of the error?

Here it is bugreport.txt

@bencroker
Copy link
Collaborator

Thanks! I wonder if this is fixed by putyourlightson/craft-blitz-hints@30cba8e.
Just released in Blitz Hints 1.2.2, can you please run composer update to get the latest version and test?

@bencroker
Copy link
Collaborator

Confirmed the fix and released in Blitz 4.13.1 too, just to be safe. Thanks again for the bug report!

@nikolenko-dmitriy
Copy link
Author

Confirmed the fix and released in Blitz 4.13.1 too, just to be safe. Thanks again for the bug report!

Yes, the fix works for me as well. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants