Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
other
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Nov 2011 at 01:31 UTC
Updated:
29 Jul 2014 at 20:09 UTC
Much of Drupal is built using associative arrays. Rendering is often dependent on array order, but there isn't any straightforward method to adjust that order. Developers must re-build the arrays(such as in panels_everywhere_page_manager_variant_operations_alter) or use weights when available. The functions drupal_array_insert_before() & drupal_array_insert_after() would be useful.
Attached is a patch adding potential implementations to common.inc below drupal_array_nested_key_exists(). I originally posted the code on my site here, then realized it could/should be in core.
| Comment | File | Size | Author |
|---|---|---|---|
| add_drupal_array_insert_before_after.patch | 2.11 KB | 13rac1 |
Comments
Comment #0.0
13rac1 commentedextra paren
Comment #1
13rac1 commentedDuplicate: #66183: Add helper methods to inject items into a particular position in associative arrays
Comment #1.0
13rac1 commentedextra here.. O_O