Problem/Motivation
If you enable page cache for anonymous users, the page cache isn't always cleared when a moderation state change impacts a published revision.
That is; when node_save() saves the node instead of a regular node form.
And if you don't have an extra module like Purge configured to clear certain caches on node_save().
Proposed resolution
Introduce an option to cache_clear_all() when a published revision changes.
Set the option off by default to provide seamless backwards compatibility.
Depend on #1436260: Saving nodes outside Workbench Moderation leads to incorrect state transitions (e.g., "needs review" appearing as published) because that issue provides a patch that adds a function that's only called when a published revision changes. And removes a node_save() call with it.
Extend an existing Simpletest test to cover the use case explained earlier.
User interface changes
None.
API changes
A new variable, called workbench_moderation_cache_clear_all
Comment | File | Size | Author |
---|---|---|---|
#23 | workbench_moderation-option_cache_clear_all-2377423-23.patch | 3.31 KB | hmdnawaz |
| |||
#14 | workbench_moderation-option_cache_clear_all-2377423-14.patch | 3.29 KB | angel.h |
Comments
Comment #1
PieterDCNumerous caching-related issues already exist, but none of them clearly defined a use case or reproduction steps, matching mine.
So, I opted to create a new issue.
Comment #2
PieterDCAttaching patch.
Comment #3
bertramakers CreditAttribution: bertramakers commentedI reviewed the interdiff with #1436260: Saving nodes outside Workbench Moderation leads to incorrect state transitions (e.g., "needs review" appearing as published) as part of a bigger review of an internal ticket at the place where I work with PieterDC.
I can't seem to find any problems with the changes, there's backwards compatibility provided so it won't break anything existing either.
I'm marking this as RTBC but obviously it will need to wait until #1436260: Saving nodes outside Workbench Moderation leads to incorrect state transitions (e.g., "needs review" appearing as published) is committed before this can be committed.
Comment #4
bertramakers CreditAttribution: bertramakers commentedComment #5
PieterDCRerolled the combined patch against 7.x-1.3 (for use in our distribution).
Comment #6
PieterDCForgot to add the new files in the patch. Added now. New patch attached.
Comment #7
colanNo longer applies cleanly; needs a re-roll.
Comment #8
iSoLate CreditAttribution: iSoLate commented.
Comment #9
iSoLate CreditAttribution: iSoLate commentedComment #10
iSoLate CreditAttribution: iSoLate commentedCreated a patch against 1.4...
Comment #12
iSoLate CreditAttribution: iSoLate commentedUpdated the test code to comply.
Comment #13
PieterDCNeeds work. Reroll the patch against 7.x-1.x
Comment #14
angel.hPatch rerolled for 7.x-1.x.
Comment #15
PieterDCComment #16
hmdnawaz CreditAttribution: hmdnawaz commentedPatch rerolled for 7.x-3.0
Comment #17
hmdnawaz CreditAttribution: hmdnawaz commentedComment #20
hmdnawaz CreditAttribution: hmdnawaz commentedComment #21
hmdnawaz CreditAttribution: hmdnawaz commentedComment #23
hmdnawaz CreditAttribution: hmdnawaz commentedUpdated the patch for 7.x-3.0 to pass the test.
Comment #24
hmdnawaz CreditAttribution: hmdnawaz commentedComment #26
hmdnawaz CreditAttribution: hmdnawaz commentedComment #27
hmdnawaz CreditAttribution: hmdnawaz commentedComment #29
hmdnawaz CreditAttribution: hmdnawaz commentedThe test is passed for the 7.x-3.x branch.