Amend listener for RSVP date start/end #3573
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Continuing work of PRs:
I noticed that the RSVP would not create start/end actions during its initial creation. That was because for our code, the WP_Post that would was created it was not yet a Ticket_Object.
So i am sending every request to sync RSVP dates to be performed during the request's end.
The conditionals being removed are already happening in
sync_ticket_dates_actions
- so the only thing that is affected by said change is that more IDs would be eligible for date sync during the request's end. But they will be correctly be filtered based on if they are Tickets or not.Why wasn't that caught by tests?
The reason is simple: order of meta keys is different for tests vs production.
see in tests:
event-tickets/tests/_support/Commerce/RSVP/Ticket_Maker.php
Line 46 in 4fbfb79
_tribe_rsvp_for_event
key comes before start/end dates, while in production comes later.As a result our
load_ticket_object
method would fail here because an event would not be found for the ticket in production, but in tests would!