-
Notifications
You must be signed in to change notification settings - Fork 17
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
EZP-31130: Ensured content variable is always present in Custom Template Twig view #84
EZP-31130: Ensured content variable is always present in Custom Template Twig view #84
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine and works here ;)
FYI : I just realized that AdminUI does NOT ensure |
Hmm, ok. Just one more reason for the change proposed here 👍 |
7016f63
to
351c24c
Compare
You can merge it up. |
Done via 0b1045f. |
v1.1.x
for eZ Platform2.5.x
LTSThis PR introduces small change - ensuring that
content
Twig variable is always present in Custom Template (Tag, Style) Twig view.eZ Platform DocBook schema (
.rng
) currently allowsezcontent
tag to be not present ineztemplate
. While AdminUI ensuresezcontent
is always set, even if empty, a DocBook comming from migratedXmlText
might not have this tag sometimes. This resulted incontent
Twig variable being not present in a Twig view for a given Custom Template, which yields a fatal error both on a front site and in AdminUI Location View.There were 3 directions to solve that issue:
ezcontent
tag during migration from XmlText to RichText.content
variable always present in a Twig view for Custom Template.The second option was rejected because RNG schema defines
ezcontent
as optional.The first option yields bad DX.
Currently this PR implements the third option, so a developer, instead of writing:
can simply write:
which is also consistent with the doc that we provide.
QA
ezcontentobject_attributes
, remove<content>...</content>
markup from XML, save, clear cache, observe the mentioned error on a front site.TODO:
content
variable in Twig views for Custom Templates.$ composer fix-cs
).