- Issue created by @pdureau
- Status changed to Needs review
4 months ago 7:22am 5 July 2024 - Status changed to Active
4 months ago 7:23am 5 July 2024 - Assigned to mogtofu33
- 🇫🇷France pdureau Paris
Also:
- Add
trans
filter to the whitelist - Add
keys
filter to the whitelist - Add
striptags
filter to the whitelist - Move
include
function from error to warning - Maybe it is too soon to raise "Return true for mapping and sequence" warning. Twig 3.11 is not release yet and
iterable
test is still the only choice
Wording changes:
- "Careful with null test." when raised by
bar is null<.code> >> "Not needed in Drupal because strict_variables=false.</li> <li>"Careful with null test." when raised by <code>bar ?? foo<.code> >> "Use `|default(foo)` filter instead of null ternary `??`" ?</li> <li>"Required props are not recommended." >> "Required props are not recommended. Use default values instead"</li> <li>"PHP URL object, or useless if URL string." >> <i>no proposal yet</i></li> <li>"Manipulate objects is not compatible with Design system." >> "PHP object manipulation must be avoided"</li> <li>"Filter `default` is not for booleans, your prop is a boolean!" >> "Don't use `default`filter on boolean"</li> <li></li> </ul> New tests proposals: <ul> <li>Can we raise a warning when <code>foo|default(false)
? We already check if
foo
is a boolean, but do we check if the filter value is a boolean? Is it relevant? - Can we detect when expression is the same in the input and value of default filter:
foo|default(foo)
. Yes, I haev seen that in contrib projects.
Kept in the grey list for beta1:
- clean_class filter
- cycle function
- spaceless filter
- safe_join filter
- nl2br filter
- Add
- 🇫🇷France mogtofu33
For the new tests seems feasible, what would be the error messages and levels?
- Merge request !141Issue #3459113 by mogtofu33, pdureau: [2.0.0-beta1] Component validator: false positive errors → (Merged) created by mogtofu33
- Assigned to pdureau
- Status changed to Needs review
4 months ago 10:08am 18 July 2024 - Issue was unassigned.
- Status changed to Needs work
4 months ago 5:46pm 18 July 2024 - 🇫🇷France pdureau Paris
Another false positive found:
[props.properties.links.description] NULL value found, but a string is required
Every components have this error, even if no links prop.
Anyway, description property is not mandatory in props defrinitions.
- Status changed to Needs review
4 months ago 6:11pm 18 July 2024 - 🇫🇷France mogtofu33
It's an error from the ComponentValidator::validateDefinition of sdc, UI Pattenrs Component validator is just relaying this.
It seems to be an error from ui_patterns_legacy, for example on ui_suite_dsfr:translate the description of the props 'links' is empty, when transformed by ui_patterns_legacy it become:
description: null
, and so the Validator raise this schema error. - 🇫🇷France mogtofu33
Still there was a problem of propagation of a ComponentValidator Exception to all components, meaning one error in ui_suite_dsfr:translate props was repeated on all components, I couldn't find why so for now I removed to proxy to componentValidator until I can do it properly.
- Assigned to pdureau
- 🇫🇷France pdureau Paris
It seems to be an error from ui_patterns_legacy, for example on ui_suite_dsfr:translate the description of the props 'links' is empty, when transformed by ui_patterns_legacy it become: description: null, and so the Validator raise this schema error.
interesting, thanks. I will create a beta1 issue about this
I couldn't find why so for now I removed to proxy to componentValidator until I can do it properly.
that was the right thing to do
- Issue was unassigned.
- Status changed to Needs work
4 months ago 8:56pm 18 July 2024 - 🇫🇷France pdureau Paris
Since the last update, I have this error
An exception has been thrown during the rendering of a template ("Drupal\ui_patterns_legacy\RenderableConverter::getNamespacedId(): Argument #1 ($component_id) must be of type string, null given, called in modules/ui_patterns_legacy/src/RenderableConverter.php on line 81").
On those components, everytim it is because of the pattern() function:
- ui_suite_dsfr:consent_banner
- ui_suite_dsfr:consent_manager because of:
{{ pattern('button_group', { attributes: {class: ['fr-consent-manager__buttons', 'fr-btns-group--inline-sm']}, buttons: [pattern('button', {label: 'Confirm my choices'|t})] }, 'right') }}
- ui_suite_bootstrap:dropdown
- ui_suite_uswds:modal
- ui_suite_uswds:tooltip because of:
{{ pattern('button', { 'attributes': attributes, 'label': label|default('Show') }) }}
But not every component template with pattern() function raise that. Mysterious...
- Status changed to Needs review
4 months ago 7:04am 19 July 2024 - 🇫🇷France mogtofu33
It looks like it's related to
ui_patterns_legacy
and notui_patterns_devel
?
Or is there something specific on devel reports? -
mogtofu33 →
committed 48e45c7f on 2.0.x
Issue #3459113 by mogtofu33, pdureau: [2.0.0-beta1] Component validator...
-
mogtofu33 →
committed 48e45c7f on 2.0.x
- Status changed to Fixed
4 months ago 10:22am 19 July 2024 Automatically closed - issue fixed for 2 weeks with no activity.