props.properties.links.description
On every component, we find this message:
[props.properties.links.description] NULL value found, but a string is required
even if there is no "links" prop in the definition.
Array of empty object.
On every with a prop with a links type, we find this message: Array of empty object.
Example:
props:
type: object
properties:
links:
title: 'List of languages'
description: null
$ref: 'ui-patterns://links'However, links prop type schema is not an empty object: https://git.drupalcode.org/project/ui_patterns/-/blob/2.0.x/src/Plugin/U...
* schema = {
* "type": "array",
* "items": {
* "type": "object",
* "properties": {
* "title": {"type": "string"},
* "url": { "$ref": "ui-patterns://url" },
* "attributes": { "$ref": "ui-patterns://attributes" },
* "link_attributes": { "$ref": "ui-patterns://attributes" },
* "below": { "type": "array", "items": { "type": "object" } }
* }
* }
* }
Missing type for this property.
In ui_suite_bootstrap:table, 2 props (stripes & divider) using $ref: 'ui-patterns://enum_list' which have type in schema:
#[PropType(
id: 'enum_list',
label: new TranslatableMarkup('List of enums'),
description: new TranslatableMarkup('Ordered list of predefined string or number items.'),
default_source: 'checkboxes',
schema: ['type' => 'array', 'items' => ['type' => ['string', 'number', 'integer'], 'enum' => []]]
)]
However, we have this error:
Missing type for this property.
Issue fork ui_patterns-3459113
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
pdureau commentedComment #3
pdureau commentedComment #4
mogtofu33 commentedComment #5
pdureau commentedComment #6
pdureau commentedAlso:
transfilter to the whitelistkeysfilter to the whiteliststriptagsfilter to the whitelistincludefunction from error to warningiterabletest is still the only choiceWording changes:
bar is null>> "Not needed in Drupal because strict_variables=false.bar ?? foo>> "Use `|default(foo)` filter instead of null ternary `??`" ?New tests proposals:
foo|default(false)? We already check iffoois a boolean, but do we check if the filter value is a boolean? Is it relevant?foo|default(foo). Yes, I haev seen that in contrib projects.Kept in the grey list for beta1:
Comment #7
mogtofu33 commentedFor the new tests seems feasible, what would be the error messages and levels?
Comment #9
mogtofu33 commentedComment #10
pdureau commentedComment #11
pdureau commentedAnother false positive found:
[props.properties.links.description] NULL value found, but a string is requiredEvery components have this error, even if no links prop.
Anyway, description property is not mandatory in props defrinitions.
Comment #12
mogtofu33 commentedIt'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.Comment #13
mogtofu33 commentedStill 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.
Comment #14
pdureau commentedinteresting, thanks. I will create a beta1 issue about this
that was the right thing to do
Comment #15
pdureau commentedSince the last update, I have this error
On those components, everytim it is because of the pattern() function:
But not every component template with pattern() function raise that. Mysterious...
Comment #16
mogtofu33 commentedIt looks like it's related to
ui_patterns_legacyand notui_patterns_devel?Or is there something specific on devel reports?
Comment #17
pdureau commentedOK, i check ui_patterns_legacy again
Comment #19
pdureau commented