Problem/Motivation
UI Suite Bootstrap sometimes use empty links to build separators:
settings:
content:
type: "links"
label: "Content"
preview:
- title: "Dropdown header"
link_attributes:
class: [dropdown-header]
- {}
- title: "Separated link"
url: '#'https://git.drupalcode.org/project/ui_suite_bootstrap/-/blob/5.0.x/templ...
This is triggering an error:
[content[5].title] Integer value found, but a string is required
See #3412076: [5.1.0] Conversion to SDC & UI Patterns 2.x
Proposed resolution
We may need to remove required: title from links prop type schema in UI Patterns 2.x: 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" } }
* },
* "required": {"title"}
* }
* }
But this required property may be necessary to not catch any array of objects. So we may add an anyOf with the 2 situations:
- empty object
- object with required title
User interface changes
No
API changes
Not breaking
Issue fork ui_patterns-3447902
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
musa.thomasComment #3
pdureau commentedComment #6
pdureau commented