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.

Comments

13rac1’s picture

Issue summary: View changes

extra paren

13rac1’s picture

13rac1’s picture

Issue summary: View changes

extra here.. O_O