- π¬π§United Kingdom joachim
> To fix it, we can replace the array_merge() with the array addition operator:
That didn't quite do it!
We also need to pass preserve_keys: TRUE to the calls to array_slice().
Fixed, and added test coverage.
- Status changed to Needs review
6 months ago 2:35pm 13 August 2024 - @joachim opened merge request.
- Status changed to Needs work
6 months ago 2:44pm 17 August 2024 - πΊπΈUnited States smustgrave
Also definitely think worth a change record to announce such a helper
- Status changed to Needs review
6 months ago 3:34pm 17 August 2024 - Status changed to RTBC
6 months ago 3:48pm 17 August 2024 - πΊπΈUnited States smustgrave
CR looks good. Thanks for including an example I personally find those always welcome and useful.
All feedback on MR addressed and appears functional.
- Issue was unassigned.
- π«π·France nod_ Lille
Shouldn't the methods be named
InsertArray::before
andInsertArray::after
? - π³πΏNew Zealand quietone
Needs work to discussion the suggestion in #115, which I also support.
What are the uses cases for this in core?
- π¬π§United Kingdom joachim
There's an array_splice() in locale_form_language_admin_overview_form_alter() that looks like a good candidate.
Also editor_form_filter_admin_overview_alter().
And #1876718: Allow modules to inject columns into tables more easily β which is mentioned in a code comment there might have more examples and should possibly be marked as related to this issue.