Issue
The Revisioning module lets you create multiple revisions of a node and keep newer revisions in "moderation" until they're ready to be published. Most fields display the correct revision, but the Title module always show the latest revision.
Steps to reproduce
1. Install dev versions of Title and Revisioning.
2. Enable Title replacement for a node type, preferably one that has a body field.
3. Open a node form of that type and enter the following values: Title = "First title", Body = "First body"
4. Leave the revision information set as "Create new revision, no moderation".
5. Save.
6. Edit the node values to be: Title = "Second title", Body = "Second body".
7. Change the revision information to be "Create new revision and moderate".
8. Save.
9. Visit the "View current" tab.
10. Note that body is "First body" and title is "Second Title".
Both values should be "First ____" since the second revision has not been published.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 1991712-3-title-revisioning.patch | 2.01 KB | milesw |
| #1 | 1991712-1-title-revisioning.patch | 781 bytes | milesw |
Comments
Comment #1
milesw commentedBecause of the way core handles field revisions, the revisioning module has to call field_attach_load_revision() directly from within hook_node_load(). This feels like somewhat of a hack, as comments in revisioning_node_load() admit, but apparently that's by design.
The real problem is that the Title module statically caches the first time a title is synced. When Revisioning calls field_attach_load_revision() the Title module thinks it's already synced and does not update with new values.
This patch clears the sync status on hook_field_attach_load().
Comment #2
plachLooks nice, thanks. I think the code for clearing static cache can be refactored in a utility function, which can then be called from everywhere we need it.
Comment #3
milesw commentedGood idea.
New patch uses the new function title_entity_sync_static_reset().
Comment #4
plachLooks good to me, thanks.
Comment #5
plachCommitted and pushed, thanks!
Comment #6.0
(not verified) commentedFormatting