Profile, placeholders and modifiers

Summary

Profile snippet and placeholders with modifiers works differently since few days

Step to reproduce

The resource is cached or not, Profile snippet is called in a template

case 1)

As recommended

Profile - Login | MODX Documentation

[[!Profile? &prefix=usr. &useExtended=1]]

Username: [[+username:default=`null`]]

always null the condition don’t work

case 2)

[[!Profile? &prefix=usr. &useExtended=1]]

Username: [[!+username:default=`null`]]

the condition work

case 3)

[[Profile? &prefix=usr. &useExtended=1]]

Username: [[!+username:default=`null`]]

the condition work

Observed behavior

case 1 stop working

Expected behavior

should work or what it happens?

Environment

MODX Revolution 2.8.4-pl

Login 1.9.7-pl

The snippet Profile has to be called uncached ([[!Profile]]), because the result is different for different requests.

When a placeholder is set by an uncached snippet, use an uncached placeholder tag to display it → [[!+username]].

(Using a cached placeholder tag ([[+username]]) might work in some cases, because the MODX parser is somewhat “lenient” and will postpone replacing placeholders it can’t find. But it will always break if you’re using an output modifier → [[+username:default=`null`]].)

1 Like

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.