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

Avoid a PHP Notice: Undefined index: tix_attendee_id #1430

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

dd32
Copy link
Member

@dd32 dd32 commented Nov 25, 2024

As we're temporarily allowing users to edit tickets without a connected user, we're hitting the above notice on every ticket edit action.

The user_must_confirm_ticket() method first does an isset() to return early if null is passed in, which is the default behaviour when referring to a array item that does not exist.

This change should have no logic changes as a result, but should result in the PHP Notice ceasing to exist.

Undefined index: tix_attendee_id
URL: https://example.wordcamp.org/2025/tickets/?tix_action=access_tickets&tix_access_token=MyTicketTokenHere
File: wp-content/plugins/camptix/addons/require-login.php:79
File: wp-content/plugins/camptix/addons/require-login.php:203

As we're temporarily allowing users to edit tickets without a connected user, we're hitting the above notice on every ticket edit action.

The `user_must_confirm_ticket()` method first does an `isset()` to return early if `null` is passed in, which is the default behaviour when referring to a array item that does not exist.

This change should have no logic changes as a result, but should result in the PHP Notice ceasing to exist.
@dd32 dd32 merged commit 86f6983 into production Nov 25, 2024
3 checks passed
@dd32 dd32 deleted the fix/notices-undefined-index-tix_attendee_id branch November 25, 2024 03:48
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.

1 participant