Problem/Motivation

When using Revision Scheduler to schedule content the URLs don't currently get purged.

Proposed resolution

Use hook to purge URLs.
Patch below.

Remaining tasks

Maybe add more support for other entity types?

User interface changes

None.

API changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Elijah Lynn’s picture

Status: Active » Needs review
FileSize
665 bytes
Elijah Lynn’s picture

Dave Reid’s picture

Status: Needs review » Needs work

This should definitely be checking if $operation->entity_type == 'node' otherwise this will fail hard if someone schedules a non-node revision.

Elijah Lynn’s picture

Status: Needs work » Needs review
FileSize
723 bytes
602 bytes

Thanks Dave,

Here is the addition.

Elijah Lynn’s picture

Here is an updated patch. 1) It adds a check to see if the Purge Status is okay 2) Removes a redundant noad load, the $entity was already there.

breathingrock’s picture

This expands on Elijah Lynn's patch, saving a diagnostic check for entities that aren't nodes, and fixes a bug that prevented running revision scheduler operations via `drush cron`.

nielsvm’s picture

Project: Acquia Purge » Cache Expiration
Version: 7.x-1.0-beta2 » 7.x-2.x-dev
Status: Needs review » Needs work

I'm very sorry guys, but I have to reject this entirely.

Not because it ain't a good idea or because it wouldn't work (or code for that sake), but simply because it shouldn't be Acquia Purge fixing this. The problem of detecting what to purge and what not to purge is incredibly hard in D=<7 and expire.module already does an incredible job of fixing this for the broad 95% of content changes.

Therefore the only place where this code should go into is the expire module - or perhaps revision_scheduler should talk to expire's hooks. Expire's my full upstream and keeping all the dirty plumbing within that module alone keeps the benefits up for all purging modules (purge, varnish, acquia_purge, etc) and the complexity of cache expiration contained within one module.

As soon as expire detects nodes to be purged (and when not to), that'll benefit everyone in one go.

Thanks for the understanding,
Niels

Elijah Lynn’s picture

Okay, thanks for explaining things out!

Elijah Lynn’s picture

I realize this won't get accepted but we are still maintaining this patch internally until we have to time to work on your suggestions. In the meantime I need to post this patch here that fixes a watchdog error.

Spleshka’s picture

@Elijah Lynn, as far as I see your patch is for Acquia Purge module. I think you will want to change project back to Acquia Purge :)

Elijah Lynn’s picture

Yes, that does make sense but it won't get into Acquia Purge and we need to work on a patch to provide Revision Scheduler support in Cache Expiration module itself. Is it okay to keep this issue here for now until we have time to work on that patch?

Spleshka’s picture

yes, we can leave it here. I am just affraid that it will be lost :)

Dave Reid’s picture

Status: Needs work » Needs review
FileSize
952 bytes

Revised patch for expire.module.

Spleshka’s picture

I completely don't mind to commit this, but right at this moment I have no time to test your patch. Can anyone do this carefully and then post here results? Patch itself looks good, it just needs a manual test.

Dave Reid’s picture

Actually I'm wondering if this would actually be needed. I would think most of the revision operations would trigger their own hook_node_update() or entity hooks as appropriate. I think this would be duplicating those calls.

Spleshka’s picture

Interesting point. So let's see if this integration is really needed :)

Dave Reid’s picture

Status: Needs review » Closed (won't fix)

This is definitely not needed.

nielsvm’s picture

This is definitely not needed.

Wondering, does that mean it moved or will move into revision_moderation then Dave?

Dave Reid’s picture

It's just not needed at all. All the revision scheduler operations use node_save() which invokes the normal hook_node_update() expiration.