- Status changed to Needs work
over 1 year ago 2:43am 27 January 2023 - πΊπΈUnited States tim.plunkett Philadelphia
There was a suggestion made for 8.9 but that isn't passing tests and may not be the agreed upon solution.
- πΊπΈUnited States gcb
I have to agree with @Anybody here. While it certainly sounds reasonable to ask all contrib modules to respond coherently in preview mode, it's not realistic: this is the perfect being the enemy of the good. If Drupal's standards for publishing modules were different, or if the feature sets offered by fully mature modules were more complete, this would be fine. It's not, and this issue has cost our clients a LOT of money, as well as frustration.
How hard would it be to catch exceptions and put something in the preview like, "preview failed for this field" below the field name in those cases? This would highlight contrib fields that needed attention without showing a whitescreen to users. It would also make it easier for developers to debug!
I have this whitescreen right now and it appears to be coming from a combination of entity references and the use of Tokens. Token is a pretty well-supported module... but there's a bug reported for it in the queue π Error: "The 'node' entity cannot have a URI as it does not have an ID" when using [node:url:relative] token Postponed: needs info that points back to this issue, and the maintainer basically saying "sounds like a layout builder problem".
As a site developer, my options here are to stop using token, to hunt down the bug in token and submit a patch (which the module developer is convinced they don't need, so I may have to maintain it indefinitely), or to apply this funky patch to layout builder that sort of blows up the entire preview behavior anyway.
I've been through this with a dozen different modules at this point. As a result, my org is very unlikely to ever use layout builder on a new site again -- it just wastes too much time hunting these things down. I like layout builder, and I want to use it! Can't we just be a little bit more accepting of our imperfections and put some safety measures in place?