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

fix: prevent "Undefined index: post_type" notice #3981

Closed
1 of 4 tasks
ravinderk opened this issue Feb 3, 2019 · 0 comments
Closed
1 of 4 tasks

fix: prevent "Undefined index: post_type" notice #3981

ravinderk opened this issue Feb 3, 2019 · 0 comments
Assignees

Comments

@ravinderk
Copy link
Collaborator

Bug Report

User Story

As an admin, I do not want any notice related to Give core.

Current Behavior

In few cases, if somehow post_type will not set in WordPress global query then we will get PHP notice.
https://github.com/impress-org/give/blob/b6b83dd7bab9e8066d9399bb40186dc642d8a817/includes/admin/forms/dashboard-columns.php#L468

Expected Behavior

The plugin must load without any notice.

Bug Type

  • This bug describes functionality that once worked as expected in version X.X.X.
  • This bug describes functionality that never worked as expected.
  • I am not sure whether this functionality ever worked as expected.

Possible Solution

Use empty to check whether this param exist or not

Related

https://wordpress.org/support/topic/error-cannot-modify-header-information-14/
https://wordpress.org/support/topic/php-notice-undefined-index-post_type/

Acceptance Criteria

  • Plugin must load without any notice if post_type does not set.
@ravinderk ravinderk self-assigned this Feb 3, 2019
ravinderk added a commit that referenced this issue Feb 4, 2019
When `post_type` does not exist in query_vars

fixes #3981
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

No branches or pull requests

1 participant