Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We should be able to sort the FieldItemList without converting back and forth to an array.
Comment | File | Size | Author |
---|---|---|---|
#12 | quick_followup-2170979-12.patch | 510 bytes | yched |
#10 | widgetBase_sortItems-2170979-10.patch | 6.21 KB | yched |
#5 | interdiff.txt | 4.33 KB | yched |
#5 | widgetBase_sortItems-2170979-5.patch | 6.21 KB | yched |
#2 | widgetBase_sortItems-2170979-3.patch | 3.71 KB | yched |
Comments
Comment #1
yched CreditAttribution: yched commentedSince we can't do a usort on a FieldItemList, then the FieldItemList needs to be able to do it for us...
Comment #2
yched CreditAttribution: yched commentedActually - there might be a case for sorting abilities on (Field)ItemList, but in our specific case here, it makes more sense to sort the raw form values before they get assigned to the field. Cleaner code in WidgetBase::extractFormValues().
Comment #5
yched CreditAttribution: yched commentedMultiple values widgets needed more care.
We should try to revive #1846162: Cleanup Widgets API : add a separate base class for 'multiple' widgets, but meanwhile this should do it.
Comment #6
yched CreditAttribution: yched commented"danse" is UK, right ? or just plain wrong ?
Comment #7
swentel CreditAttribution: swentel commented5: widgetBase_sortItems-2170979-5.patch queued for re-testing.
Comment #8
swentel CreditAttribution: swentel commentedNice cleanup. Asked for a retest just to be sure, RTBC when it comes back green.
Comment #9
yched CreditAttribution: yched commented5: widgetBase_sortItems-2170979-5.patch queued for re-testing.
Comment #10
yched CreditAttribution: yched commentedReroll after #2141539: Rename FieldItemListInterface::filterEmptyValues() to filterEmptyItems()
Comment #11
alexpottNice tidy up - Committed a59a468 and pushed to 8.x. Thanks!
Comment #12
yched CreditAttribution: yched commentedSorry, quick minor followup - don't know what got into me, that added "return" is totally useless.
Trivial, setting straight back to RTBC. Spank me :-)
Comment #13
alexpottCommitted 85a75d4 and pushed to 8.x. Thanks!