- Issue created by @Grimreaper
- Merge request !166Issue #3465453 by Grimreaper, pdureau: Validation error with empty attribute object in link β (Merged) created by Grimreaper
- Issue was unassigned.
- Status changed to Postponed
4 months ago 12:50pm 2 August 2024 - π«π·France Grimreaper France π«π·
MR created, but let's wait if I or someone else manage to reproduce the bug.
- Assigned to pdureau
- Status changed to Needs work
4 months ago 1:20pm 2 August 2024 - Assigned to Grimreaper
- π«π·France pdureau Paris
@grimreaper, OK with that? If yes, let's ask Steven to review and to confirm the usefulness of such a change.
- Assigned to pdureau
- π«π·France Grimreaper France π«π·
Ok with the change.
But PHPMD and PHPStan also caught what I saw in my code review ;)
- π«π·France pdureau Paris
Sorry for this stupid mistake. I have amended the commit.
The work may not be not over anyway:
Steven - Today at 1:48 AM
unfortunately still seems broken without ui devel
May be related but is the LinksPropType normalize suppose to turn the attributes into an array vs a Drupal Attribute object?
Pierre - Today at 7:49 AM
indeed. It was necessary a few month ago because we were running normalize before SDC validator, but it seems we are now running it after SDC validator, so we may be able to remove this part.So, I will test that
- Issue was unassigned.
- Status changed to Needs review
3 months ago 9:18am 9 August 2024 - π«π·France pdureau Paris
2 big changes:
1
I have added Steven's example to the test cases and I understood the normalization of
link_attributes
was not happenig at the right place.Preventing the possibility of defining link_attributes manually in presenter templates:
[ "title" => 0, "url" => "?page=0", "attributes" => new Attribute(), "link_attributes" => new Attribute([ 'class' => [ 'display-flex', 'flex-align-center', 'flex-no-wrap', ], ]), ]
https://git.drupalcode.org/project/ui_patterns/-/merge_requests/166/diff...
2
I have improved the management of
link_attributes
by merging existing values with the ones extracted from the Url objects.And I removed the transformation of
Attribute
objects to arrays, because SDC is not complaining anymore about that. Maybe because PropTypeInterface::normalize() now happens after the SDC validator is run.https://git.drupalcode.org/project/ui_patterns/-/merge_requests/166/diff...
- Status changed to Fixed
3 months ago 7:20am 11 August 2024 -
pdureau β
committed 53471f68 on 2.0.x authored by
Grimreaper β
Issue #3465453 by pdureau, Grimreaper, smustgrave: Validation errors...
-
pdureau β
committed 53471f68 on 2.0.x authored by
Grimreaper β
- Status changed to Fixed
3 months ago 2:49pm 12 August 2024