Problem/Motivation
In SectionLibraryRender.php you do:
$last_item_section = array_pop($sections[$key]);
This will pop the lost item of the array in my case:
['layout-builder__section' => [allSections]
Propose to preserve array key
Patch attached.
Todo
Review & double test/check
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3275451-3-11.diff | 1.1 KB | kriboogh |
Issue fork section_library-3275451
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:
- 3275451-add-save-to
changes, plain diff MR !11
Comments
Comment #3
kriboogh commentedTested, applies and works (been using it in production for over a year now).
MR diff added for use in composer.
Comment #4
kevinquillen commentedSeems related to #3416266: Switch from using array_pop/array_push for section manipulation to preserve key integrity and ensure module integration compatibility
Comment #5
kevinquillen commentedComment #6
rajab natshah