Follow-up to #2674520: Add current revision filter to views
Problem/Motivation
The last issue added a table to track the latest revision of entities that are moderated. However, if you have pre-moderation entities they won't be in that table. That could lead to all sorts of I don't know what badness.
Proposed resolution
If it can be done efficiently, pre-populate the table when an entity bundle is first moderation-enabled.
If not, just track everything always, which will necessitate a single larger pre-populate command on install.
Remaining tasks
Decide on approach.
Implement.
Test.
User interface changes
None.
API changes
TBC.
Data model changes
TBC.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2701365-legacy-tracker.patch | 4.45 KB | Crell |
Comments
Comment #2
Crell commentedSo after some experimentation and consideration, I think this is fine. Turns out, WBM D7 didn't handle legacy content either. Also, nothing actually breaks for legacy content; it just doesn't show in latest-revision views, which is in practice probably not a big problem as you'd be building such a view for content that needs moderator attention. If it's unmoderated, and thus its default version is published, you wouldn't want it in that view anyway.
The only problem is if someone uses the views filter before the table has EVER been created, in which case you get an missing SQL table explosion. The attached patch fixes that. It's not the ideal approach but it works and I don't know of a better one.
Comment #3
dawehnerworks for me, unless you want to add a quick line of documentation.
Comment #4
Crell commentedAdded several quick lines of documentation and merged. Thanks, dawehner.