Bug with rollout of 6.03

With the rollout from 5.9.x to 6.0.x, the use of the below technique has caused a problem on my live site:

Adding a snippet like this:
{% component type: “snippet”, alias: “menu_{{request.device_type}}” %}

to dynamically load a snippett with alias:
“menu_desktop” vs
“menu_mobile”

Is not working.

This seems to be because {{request.device_type}} outputs with a capital eg. Desktop or Mobile,
Whilst a snippet can only have lower case letters for its alias.
(not sure which bit changed in v6)

Ive tried outputting the snippet by ‘name’ instead of ‘alias’ but this doesn’t work either.

So this technique is broken at this stage.

I’ve lodged a ticket, but it might help if someone from the forum in close contact with the devs could advise them of this and provide an asnwer as to whether its a bug.

This is a critical error for me and will take a long time to recitfy with another method accross my site,
and its likely just a bug that will get fixed, so I dont want to waste time changing things that dont need to be. That said either the bug needs fixing quickly or I need to change things quickly.

Hi @Reagan_Vautier

I don’t know the state of this issue, bu tif you do need a quick fix, using the | downcase filter should do the trick:

However, yes, this will likely pose a bigger issue so will be interesting what the outcome is from the dev team.
One would think case-sensitivity is something imposed by the system and therefore this would be a change we’d have to adjust for… but hopefully not :crossed_fingers:

PS: device_type was previously title case, ie: “Desktop”, so yes, it’s a case-sensitivity issue with snippet aliases.

Hi Adam,
Thanks so much, “| downcase” working well and a fast fix :slight_smile:

Thanks for the heads up @Reagan_Vautier - I use the “device_type” quite a lot for different types of menus, styling etc. so really bad news :frowning:

Not looking forward to going through all sites with the new changes, but I fully understand that these things need to be fixed, so everything works in the same way.

It may be something worth mentioning here: https://docs.treepl.co/extras/migrating-from-liquid-2-to-3
if this is a thing partners need to do :slight_smile: @Adam.Wilson :+1:

1 Like

Hi
I checked this issue in our bug tracking system, we have this bug, thanks for the message

1 Like

From what I understand both “desktop” and “Desktop” etc. right @Anastasia? :slight_smile:

Yes, both variants will be work