New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added resource ids to OnResourceAutoPublish param #12747

Merged
merged 1 commit into from Dec 2, 2015

Conversation

Projects
None yet
3 participants
@christianseel
Contributor

christianseel commented Oct 31, 2015

What does it do ?

This PR extends the $results parameter of the OnResourceAutoPublish event with $results['published_resources'] and $results['unpublished_resources']. Those give developers, besides the number of published/unpublished resources, also the IDs of those resources.
It actually includes the id, context_key and pub_date.

Why is it needed ?

Now you can write a plugin that clears custom cache partitions for the auto-published resource or it's parents because you get the resource id from the event. Without getting the IDs, the event is pretty useless from my perspective.

@rtripault

This comment has been minimized.

Collaborator

rtripault commented Nov 26, 2015

👍 definitely useful when dealing with custom cache partitions!

@christianseel

This comment has been minimized.

Contributor

christianseel commented Nov 28, 2015

@rtripault any chance you can merge this as well?

@Mark-H Mark-H added this to the v2.5.0-pl milestone Dec 1, 2015

@Mark-H Mark-H merged commit 1d567fe into modxcms:2.x Dec 2, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Mark-H

This comment has been minimized.

Collaborator

Mark-H commented Dec 2, 2015

Thanks @christianseel for your contribution :) I've merged it into 2.x for inclusion in 2.5.

It might make sense to extend this behaviour a bit further so it also includes the unpub_date in unpublished_resources? I guess the most important parts are the ID and the the context_key though, and with those you can get any value, so not a very high priority.

@christianseel

This comment has been minimized.

Contributor

christianseel commented Dec 8, 2015

Thanks Mark! Submitted another PR that adds unpub_date!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment