- Issue created by @anruether
- 🇫🇷France pdureau Paris
Hi @anruether,
You are using loading your card component via a presenter template (
node--h4d-project--h4d-card.html.twig
).So, as far as I know, UI Patterns has a limited action on your
content
slot (TwigExtension::normalizeProps() calling SlotPropType::normalize()) because UI Patterns is focusing on displays built in config and processed through the Render API.So, I don't know why something is different after you enable
ui_patterns
.It may not be related, but I see some "risky" stuff in the snippets you shared. For example, you are feeding component props with data coming from
content
variable (so renderables, perfect for the slots) instead of data coming fromnode
variable (typed data, perfect for the props):image: content.field_h4d_project_image, offers_commercial: content.h4d_offer_commercial_group_content_eva_entity_view_1, offers_invest: content.h4d_offer_invest_group_content_eva_entity_view_1, offers_person: content.h4d_offer_person_group_content_eva_entity_view_1, profile_housing: content.field_h4d_profile_housing,
Can you run https://www.drupal.org/project/sdc_devel → and see of you have some errors?
- 🇩🇪Germany anruether Bonn
@pdureau Thanks for looking into this. I also appreciate the feedback on the code!
Can you run https://www.drupal.org/project/sdc_devel → and check if you have some errors?
I installed sdc_devel, but I don't experience the same behaviour. The variables excluded via
|without
filter do not show up. - 🇫🇷France pdureau Paris
The variables excluded via |without filter do not show up.
So you are back to the expected behaviour? Is it OK now?
I installed sdc_devel, but I don't experience the same behaviour.
I didn't propose
sdc_devel
as a fix, and this module has normally nothing to do with the behaviour of|without
filter in a Twig block.It was to run the component validator to check if some errors were caught. You can run the validaor
...with a drush command:
$ vendor/bin/drush sdcv --install my_theme [notice] Start validation of my_theme... ----------------- Component Severity Message ----------------- local-tasks Warning Deprecated Twig filter: `spaceless`. The spaceless filter is deprecated as o page Warning Use slots instead of hard embedding a component in the template with `embed` form-element-label Error Unknown variable: `title_display`. form-element-label Warning The exact same as just testing the variable, empty is not needed. dropdown-menu Error Array of empty object. dropdown-menu Warning `is iterable` test is too ambiguous. Use `is sequence` or `is mapping`.
... or from the admin UI:
- 🇩🇪Germany anruether Bonn
@pdureau
So you are back to the expected behaviour? Is it OK now?
I didn't propose sdc_devel as a fix, and this module has normally nothing to do with the behaviour of |without filter in a Twig block.
That was a misunderstanding on my side. I assumed you asked me to deinstall ui_patterns and install sdc_devel to check if there is code in sdc_devel which triggers the error as well. And no, installing ui_patterns and sdc_devel leads to the behaviour described in the issue summary.
I have proposed it to run the component validator to check if some errors were caught. You can run the validaor
That makes sense ;) I'm getting a lot of errors. In the next step I'll create an isolated SDC and try to reproduce the error without the errors.