You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@JohnathonKoster Do you have any ideas about what's happening here?
Its leveraging previous assignments inside Antlers, or entirely new variables created inside PHP in order to detect what should be pushed back up after executing the PHP code. This could be expanded to also include a "did variable change" check.
For example, if we had something like this, it would pick up on the change since title is available in its list of items to pay attention to (not saying this is the solution, just an example to help demonstrate):
{{ title=title/}}
{{? $title = 'a new title';?}}
{{ title/}}
From my point of view, having php tags able to manipulate the current context (and its existing variables) is a powerful feature. On the contrary, not beeing able to do it, seems counter intuitive (+ the fact it's not documented).
Bug description
In an antlers template creating a variable with a native php tag works fine :
altering this newly created variable also works fine :
BUT, if the variable already exists in the cascade, we cannot alter it ...
For instance, if the "title" variable already exists in the cascade with the value "myTitle", it wont be updated...
interestingly, if within the {{? ?}} tag itself, the override happens :
{{? $title= "overridden title"; dd($title}} ?}} {{# outputs "overriden title" #}}
note it's a project with statamic 3.4.11, but i'm pretty sure it also happens on the last versions...
How to reproduce
just use the above examples
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
The text was updated successfully, but these errors were encountered: