- Merge request !5154Resolve #2989889 "Draggable list builder trait" β (Closed) created by tstoeckler
- Status changed to Needs review
about 1 year ago 12:50pm 27 October 2023 - π©πͺGermany tstoeckler Essen, Germany
Converted the patch into a MR now, with #17 as the initial commit so my changes are easily reviewable. Went ahead and implemented #8 now with a tiny change in
EntityListBuilder
(to set$this->formBuilder
) (but not changes required in any sub-classes). And also fixed #26. Verified that everything still works and also verified that adding more property or return type hints causes breakage because that would require sub-classes to also specify those. - Status changed to RTBC
about 1 year ago 6:46pm 27 October 2023 - πΊπΈUnited States smustgrave
Seems points #26 have been addressed in MR 5154. Since this was previously RTBC before that going to restore
- Status changed to Fixed
11 months ago 5:21pm 8 January 2024 - π¬π§United Kingdom joachim
I was going to file a follow-up for the injection of formBuilder, but π Replace non-test usages of \Drupal::formBuilder() with IoC injection Needs work should cover it.
- Status changed to Needs work
11 months ago 10:49pm 8 January 2024 - π©πͺGermany jurgenhaas Gottmadingen
The commit from #33 expects a return value
int|float
for thegetWeight
method inDraggableListBuilder
. I just came across a config entity, that has a weight property, but that may be NULL. In that case, this throws an exception.Should the
getWeight
method maybe fall back to 0, if the weight property has no value? - Status changed to Needs review
9 months ago 8:59pm 1 March 2024 - π©πͺGermany tstoeckler Essen, Germany
Re #35: fair enough, makes sense. Added a draft change notice: https://www.drupal.org/node/3425054 β . Feel free to publish if you think it's alright. (And then ideally set the issue back to fixed)
Re #37: Wow, never thought of that possibility, but yeah, totally makes sense to not blow up in that case, doesn't really cost much to add that fallback: Opened π [regression] Add a fallback in DraggableListBuilder::getWeight() to support entities with a NULL weight Needs review Sorry for the trouble and thanks for reporting it.
- Status changed to RTBC
9 months ago 11:41pm 1 March 2024 - πΊπΈUnited States smustgrave
Marking RTBC for the CR. Would like a committer to also see before publishing it.
- Status changed to Fixed
9 months ago 10:29am 2 March 2024 - π¬π§United Kingdom joachim
> The commit from #33 expects a return value int|float for the getWeight method in DraggableListBuilder. I just came across a config entity, that has a weight property, but that may be NULL. In that case, this throws an exception.
Similar issue -- I've just tried to use DraggableListBuilder on a config entity, and got a crash because the weight is a string not an int.
- π¬π§United Kingdom joachim
Follow-up -- and I wonder whether we should fix this rather than document it: π DraggableListBuilder / DraggableListBuilderTrait need to document that buildRow() behaves completely differently from the parent class Active .
- π©πͺGermany tstoeckler Essen, Germany
Re #41: Interesting, that didn't come up here because that would be fixed as soon as you add config schema to your entity type. But I guess it wouldn't hurt to add a
(float)
type-cast togetWeight()
. I can open a follow-up for that, if people think that makes sense. - π¬π§United Kingdom joachim
Ah yeah, the bug is that environment_indicator has declared this incorrectly:
weight: type: string label: 'Name'
> But I guess it wouldn't hurt to add a (float) type-cast to getWeight(). I can open a follow-up for that, if people think that makes sense.
On second thoughts, we shouldn't babysit that, but we should instead add something to the trait docs to say the weight field must be an int.
Automatically closed - issue fixed for 2 weeks with no activity.