Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When re-saving a display of a view after setting the machine name (not edit, just open and click apply) the display will be deleted.
Steps to reproduce:
- Open an existing view that has an display mode.
- Click "Advanced" -> "Other" -> "Machine Name".
- Do NOT alter the machine name, but do click on Apply.
- Save the view.
Results in a “The requested page could not be found.” and a deleted view display.
Comment | File | Size | Author |
---|---|---|---|
#5 | 2897576-5.patch | 2.1 KB | Lendude |
#5 | 2897576-5-TEST_ONLY.patch | 1.03 KB | Lendude |
Comments
Comment #2
MustangGB CreditAttribution: MustangGB commentedComment #3
LendudeI can reproduce this issue.
Don't know of any duplicates (there are other machine name issues, but not this one as far as I know or can find)
This might actually be Critical since it leads to data loss.
Comment #4
swentel CreditAttribution: swentel at eps & kaas for MuseScore commentedyeah, feels pretty critical to me too :)
Comment #5
LendudeThis is where the logic goes wrong:
If new_id and id are the same
unset($displays[$id]);
will toss the display.Test and fix. Bumping to critical for the data loss.
Comment #6
dawehnerI agree loosing that data is critical. Personally I was never a huge fan of renaming those display IDs, but people seem to really love that particular feature.
I'll wait to see the test only patch to get back red :) The fix looks like the right thing to do.
Comment #8
dawehnerNice!
Comment #12
catchStraightforward fix and good find. Committed/pushed/cherry-picked to all three 8.x branches.
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedContinue here #2915175: Duplicating a Page to Block after changing the display id and then saving the view destroys the Page