Problem/Motivation
When trying to access a route that doesn't exist, the following edge-case can happen:
Error: Call to a member function label() on string in editoria11y_page_attachments() (line 248 of /web/modules/contrib/editoria11y/editoria11y.module).
#0 /web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(315): editoria11y_page_attachments()
For me, this happened when trying to access:
https://www.example.com/user/1234/orders/56789
AFTER deleting the user with id 1234 - so that route isn't valid any more. Instead of a 404 or something like that, this error appeared.
I'm pretty sure this is an edge-case, but it should be solved.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
itmaybejj commentedComment #6
itmaybejj commentedIt is an edge case and not something I can reproduce in a vanilla install.......but mapping all these strings for the page attachment requires using so, so many entity-type-specific class calls that someone finds a new edge case at least once a year.
I'll keep fixing them whenever I can reproduce them, but at the least it's time to wrap this part of the code in a big old try/catch block to reduce edge-case-problems to logger warnings rather than site crashes.
3.x will also add dashboard maintenance scripts to identify and remove or update URLs for old records. That should help on sites that have been running for a while.
Comment #7
itmaybejj commentedComment #8
anybodyThanks for the fixes @itmaybejj! I'm not really able to review the many changes, but I think you know what you're doing. :)
Comment #9
agoradesign commentedThis happened to me on a commerce order page as well, but the customer user entity wasn't deleted at all
Patched 2.2.19 with the commit above, works for me :)
Comment #10
anybodyNICE @agoradesign even better!! 🎉🥳
Comment #12
itmaybejj commentedSplendid. 2.2.20 tagged.