Shopify / liquid

Liquid markup language. Safe, customer facing template language for flexible web apps.

Home Page:https://shopify.github.io/liquid/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

App Block Missing Data On Theme Previews When Proceeded by a Hidden Section Containing an @app Block

v-pani opened this issue · comments

Describe the current behavior

When a theme section containing our app block/theme extension is placed directly after a hidden section which contains an app block, liquid data is not correctly passed to our app block.

Describe the expected behavior
Block liquid data should be available to the app block regardless of block/section order and customiser "visibility" status

Version information (Dawn, browsers and operating systems)
Dawn Version: 13.0.1
(as well as all themes)

Chrome Version 108.0.5359.124
macOS Version 13.1

Possible solution
This appears to be a bug in the Shopify liquid parser and specifically impacts offline/preview themes so possible solutions are unclear

Additional context/screenshots

Partner created issue in Dawn theme repository: Shopify/dawn#3413

INCORRECT BEHAVIOR
https://screenshot.click/23-18-83764-334.png

CORRECT BEHAVIOR
https://screenshot.click/23-18-53103-15399.png

From the partner: https://partners.shopify.com/internal/organizations/183065

QUOTE:

_I'm reaching out as we've discovered a bug with Shopify's parsing of theme sections as result of an issue brought to our attention by a number of merchants using our app.

To give you a brief overview of the bug:

  • What we're noticing is that when our app block is proceeded by a HIDDEN section which contains any other app block, liquid data is not correctly passed to our app block / widget.
  • We're able to reliable reproduce this across stores and themes
  • The specific data in this case is the ID of a product in a product page template, derived from {{ block.settings.product.id }}
  • We've also noticed through testing that this issue may potentially manifest itself slightly differently, depending on the region a user is visiting the merchant's store from. While we're not 100% certain of this, we believe based on our testing that this bug may for example only impact offline theme previews for AU visitors whereas for US visitors, the impact can be seen on live themes.

The specific issue this bug causes in our case (which is what merchants are reporting to us) is that due to the missing product ID value, our review app widget falls back to displaying all reviews as opposed to only those belonging to the specific product being viewed by the user.

I've reported this issue on the Dawn theme GitHub repository here: Shopify/dawn#3413 Although admittedly, since this bug impacts all themes, that repository likely isn't the ideal place for the bug report.

It would be great to have this bug investigated and ideally resolved. Please let me know if any further information is needed._