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

make get_options a bit more robust. #2603

Merged
merged 2 commits into from
Aug 3, 2023
Merged

make get_options a bit more robust. #2603

merged 2 commits into from
Aug 3, 2023

Conversation

rawdreeg
Copy link
Contributor

@rawdreeg rawdreeg commented Aug 3, 2023

Changes proposed in this Pull Request:

We assume that if the serial object is “correct”, meaning an array, then we return it to the caller to check if the index is there. This PR will set an index to the default when such index does not exist in the config

  • Do the changed files pass phpcs checks? Please remove phpcs:ignore comments in changed files and fix any issues, or delete if not practical.

Detailed test instructions:

  1. Switch to this branch.
  2. log in as an admin, navigate to wp-admin/options.php, then set the value of the content of facebook_config to a random string. e.g: 10k
  3. navigate to any admin page. Then check the value of facebook_config and confirm this is a valid serialized object. And repeat this test by setting facebook_config to an empty value.

Changelog entry

Fix - WC_Facebookcommerce_Pixel::get_options() throwing a fatal error if facebook_config is invalid

@rawdreeg rawdreeg requested a review from a team August 3, 2023 13:27
@rawdreeg rawdreeg self-assigned this Aug 3, 2023
@github-actions github-actions bot added changelog: fix Took care of something that wasn't working. type: bug The issue is a confirmed bug. labels Aug 3, 2023
@rawdreeg rawdreeg added type: enhancement The issue is a request for an enhancement. and removed type: bug The issue is a confirmed bug. labels Aug 3, 2023
Copy link
Contributor

@ibndawood ibndawood left a comment

Choose a reason for hiding this comment

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

Thank you, @rawdreeg, for the changes. I tidied up the spacing a bit in the unit test case file.

@rawdreeg rawdreeg merged commit d0556c8 into develop Aug 3, 2023
5 checks passed
@rawdreeg rawdreeg deleted the fix/2516 branch August 3, 2023 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: fix Took care of something that wasn't working. type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants