Skip to content
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

Returning feedData from beforeProcessFeed() and counting the number of items after, instead of before #619

Merged
merged 1 commit into from
Jan 2, 2020

Conversation

kristiansp
Copy link
Contributor

The proposed changes adds the feed data returned from EVENT_BEFORE_PROCESS_FEED to the return array, and counts the number of items after beforeProcessFeed() is called, instead of before. This gives the ability to actually modify the feed data via the EVENT_BEFORE_PROCESS_FEED event.

The change in #462 give the EVENT_BEFORE_PROCESS_FEED the ability to change the $feedData in the event. However, as nothing else is happening in the beforeProcessFeed() function, and the feed data is not part of the $return array returned from the function, any changes made to the actual feed data is effectively lost.

Furthermore, as the items in the feed data are counted before beforeProcessFeed() is called, any changes to the number of items in the feed (e.g. removing duplicates), will give the wrong number of iterations in the queue.

@kristiansp kristiansp changed the title Returning feedData from beforeProcessFeedEvent and counting them after Returning feedData from beforeProcessFeed() and counting the number of items after, instead of before Oct 20, 2019
@brandonkelly brandonkelly merged commit c33e573 into craftcms:develop Jan 2, 2020
@brandonkelly
Copy link
Member

Agree this is better. Thanks!

@brandonkelly
Copy link
Member

Feed Me 4.2.0 is out now with this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants