Fix for incorrect ticket count in query when running more than on provider. #3594
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.
Discovered while doing prelim work for presets. ETP-988
ET-2317
This line:
$args['meta_query'] = array_merge( (array) $args['meta_query'], (array) $module_args['meta_query'] );
Overwrites the
relation
set in$args
with the default "AND"So if we are running two providers (such as TC and RSVP) and we check for ticket IDs on a post (with an ID of 215 below) the final query will be:
Note the "AND" - so this will fail, and the function will always return 0 tickets found. It can't be both an RSVP AND a ticket (or a ticket from two providers simultaneously).
Also fixed the docblocks for
get_tickets_ids()
and the calledTribe__Tickets__Tickets::set_tickets_query_args()
as neither can currently handle getting a post object passed to them 😞