Skip to content

Commit

Permalink
Fix existing attendee format to be only ints or nulls
Browse files Browse the repository at this point in the history
  • Loading branch information
dpanta94 committed Jan 7, 2025
1 parent 69d5813 commit 7ec2340
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Tickets/Commerce/Attendee.php
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,9 @@ public function upsert( \WP_Post $order, $ticket, array $args = [], ?int $existi
$update_args['fields'] = $fields;
}

// No need to update the security code.
unset( $update_args['security_code'] );

/**
* Allow the filtering of the update arguments for attendee.
*
Expand Down
6 changes: 5 additions & 1 deletion src/Tickets/Commerce/Flag_Actions/Generate_Attendees.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,12 @@ public function handle( Status_Interface $new_status, $old_status, \WP_Post $ord
'ticket_id' => $ticket->ID,
'event_id' => $ticket->get_event_id(),
]
)->fields( 'ids' )->all( true ) as $attendee_id
)->get_ids( true ) as $attendee_id
) {
if ( ! is_int( $attendee_id ) || 0 >= $attendee_id ) {
$existing[] = null;
continue;
}
$existing[] = $attendee_id;
}

Expand Down

0 comments on commit 7ec2340

Please sign in to comment.