Problem/Motivation
When a view uses multiple attachments to be displayed in the same location (e.g. all "above" or all "below"), they are added in order of their machine names, rather than the order specified in the view.
This behavior is not obvious to the user, and changing a display's machine names likely leads to unsemantic naming. If done at a later point, this can furthermore lead to problems because of the old machine name being used in code etc.
Steps to reproduce as an example:
- Create a "pets" view with a
page
and twoattachment
displays, "cats" and "dogs", both set to output "after" the page. - Click on "Reorder displays" and sort them as "page_1", "dogs", "cats".
- On the pets page, the cats will be output before the dogs even though configured differently.
Proposed resolution
Since displays can be rearranged by the user, the attachments should adhere to this order.
Remaining tasks
Write a test for this scenario, review the patch.