Needs review
Project:
Save Draft
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Jan 2013 at 08:58 UTC
Updated:
21 Jul 2014 at 09:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
nielsvm commentedThat's a valid concern yet a less easy fix, or better put, at a different layer. Once the Acquia Purge module is told - by expire.module or customer code - to purge a certain path it will do its utter best to purge that individual path as good as possible and in all potentially existing forms. So if node/1 had to be purged it might issue 1 or even 10 purges depending on the amount of domains.
Yet that's not the issue here. The event has already been submitted by the expire module and we simply adhere and do what it asks. Technically the expire module listens on node_save() events and has probably no integration or understanding about the save_draft module. Therefore the only fix for this is a integration with that module in expire, for instance using a conditional if (module_exists('save_draft')) check to not purge when that module is into play saving a non public node.
I'm forced to close this as won't fix :(, yet I advise to file a ticket at the save_draft or expire project and to link to this comment.
Comment #2
anavarreRe-opening but changing project. Please read #1 for implementation ideas.
Comment #3
spleshkaChange branch version. 7.x-2.x has a lot of difference from 7.x-1.x.
Comment #4
spleshkaIn 7.x-2.x branch you may configure your own expiration rules using Rules + Cache expiration modules.
Comment #5
spleshkaForgot to change version number.
Comment #6
nielsvm commentedMy apologies for reopening this, although I believe with valid reasons. We can't expect site users to be working around this with a rule every time they would install the save_draft module, hence that won't even work as we don't want expire events to go out at all instead of influencing them with a rule.
The scope of this issue is:
Don't include node/X in hook_expire_cache() events once a user uses the "Save as draft" button when they have the save_draft module enabled!
There's a couple of ways forward IMHO.
Comment #7
spleshkaI like a second way. Moreover, hook_expire_cache_alter() is already exists, and save_draft module may implement it to remove node/[nid] path from being expired.
Comment #8
nielsvm commentedMy apologies @Spleshka for not checking the existence of hook_expire_cache_alter() myself! That essentially moves the responsibility of implementing this to the save_draft module, can you guys look into this issue?
Thanks!
Comment #9
spleshkaPatch attached.
Comment #10
spleshkaSuppose this is a feature request, not a bug.
Comment #11
spleshkaCould anyone review this patch please?
Comment #12
anavarrePatch didn't apply cleanly for me both with patch -p1 in the module directory or with cURL. Did you make it against 7.x-1.4?
Comment #13
spleshkaNo, patch should be applied to 7.x-1.x. Download project using Git:
Then apply patch in #9:
Comment #14
anavarreSorry I took ages to get back to this but I've tested the patch (successfully applied against 7.x-1.x) with Acquia Purge and I'm still getting the purges.
Is this working ok for you with both Purge and Acquia Purge or only Purge?
Comment #15
spleshkaI've tested this only for Purge module. Please ensure that you are using Cache Expiration 7.x-2.x branch.
Comment #16
nielsvm commentedI'm less concerned about whether it works on Acquia Purge or not, if it works properly on Purge it will do so on Acquia Purge too. If expire now doesn't emit the purging signals during these workflow states we're fine.
Thanks a tonne!
Comment #17
rooby commentedThanks for the patch. As previously mentioned, if it works with purge it should work the same with Acquia purge.
The problem seems to be that the variable_get() call was not giving a default value, so if you haven't specifically saved the draft settings of your node type this would not have worked.
Here is a new version of the patch that addresses this.
Works for me but can someone confirm before I commit?
Comment #18
rooby commentedComment #19
anavarreNot sure if I've tested things correctly here but with the latest Acquia Purge and Save as Draft dev releases + the patch in #17 applied, I still get purges when saving a node as draft.