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

Prevent possible error when accessing an index #17233

Merged
merged 1 commit into from Feb 18, 2021
Merged

Prevent possible error when accessing an index #17233

merged 1 commit into from Feb 18, 2021

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Feb 18, 2021

Description:

see https://wordpress.org/support/topic/undefined-index-piwik_pro_ads_enabled/

I think this should fix the issue. It's technically only a workaround. Not sure why this would show up as an error. I will try to find out more to see if there's a general issue there.

Review

  • Functional review done
  • Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • Security review done see checklist
  • Code review done
  • Tests were added if useful/possible
  • Reviewed for breaking changes
  • Developer changelog updated if needed
  • Documentation added if needed
  • Existing documentation updated if needed

see https://wordpress.org/support/topic/undefined-index-piwik_pro_ads_enabled/

I think this should fix the issue. It's technically only a workaround. Not sure why this would show up as an error. I will try to find out more to see if there's a general issue there.
@tsteur tsteur added the Needs Review PRs that need a code review label Feb 18, 2021
@tsteur tsteur added this to the 4.2.0 milestone Feb 18, 2021
$oldSettingValue = @$configGeneralSection['piwik_pro_ads_enabled'];
$oldSettingValue = false;
if (isset($configGeneralSection['piwik_pro_ads_enabled'])) {
$oldSettingValue = @$configGeneralSection['piwik_pro_ads_enabled'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need the @ here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose technically not but might also not hurt?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems redundant, but ok

@diosmosis diosmosis merged commit 8a2b642 into 4.x-dev Feb 18, 2021
@diosmosis diosmosis deleted the mwpindex branch February 18, 2021 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants