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

2.11.4 - Pass_Manager needs to check if highest pass ID exists before comparing #8965

Closed
ashleyfae opened this issue Nov 1, 2021 · 0 comments · Fixed by #8966
Closed

2.11.4 - Pass_Manager needs to check if highest pass ID exists before comparing #8965

ashleyfae opened this issue Nov 1, 2021 · 0 comments · Fixed by #8966
Assignees
Labels
Milestone

Comments

@ashleyfae
Copy link
Contributor

Bug Report

Expected behavior

When I call Pass_Manager::hasPersonalPass() on a site that has no passes, I expect it to return false.

Actual behavior

The following exception is thrown:

InvalidArgumentException: Invalid pass 1:

The same is true for all other pass methods introduced in #8953

It just calls:

return self::pass_compare( $this->highest_pass_id, self::PERSONAL_PASS_ID, '=' );

But when $this->highest_pass_id is null, it doesn't work. We should be checking that before running the comparison.

Steps to reproduce the behavior

  1. Have a site that has no passes activated.
  2. Run any of the new helper methods.
  3. Note exception error.

Information (if a specific version is affected):

PHP Version:

EDD Version (or branch): release/2.11.4

WordPress Version:

Any other relevant information:

@ashleyfae ashleyfae added this to the 2.11.4 milestone Nov 1, 2021
@ashleyfae ashleyfae self-assigned this Nov 1, 2021
@ashleyfae ashleyfae linked a pull request Nov 1, 2021 that will close this issue
ashleyfae added a commit that referenced this issue Nov 3, 2021
ashleyfae added a commit that referenced this issue Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant