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 undefined array keys in category_page_renders function #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bianqui149
Copy link

Problem

The function category_page_renders was throwing an error: Undefined array key "v3_widgets_enables" and Undefined array key "v2_widgets_enables". This issue occurred when the $settings array did not include these keys, leading to unexpected behavior or crashes.

Solution

  • Added checks using isset() to ensure the keys v3_widgets_enables and v2_widgets_enables exist before attempting to access them.
  • Applied !empty() to verify that the values are not null or empty before performing actions.
  • This prevents the function from attempting to access non-existent array keys, ensuring smoother execution without errors.

Testing

  • Manually tested with different $settings configurations to ensure the function behaves as expected and no longer throws the error.

Impact

This fix ensures that the category_page_renders function handles cases where the $settings array might not contain the expected keys, improving overall stability.

@bianqui149 bianqui149 requested a review from a team as a code owner August 12, 2024 16:53
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.

2 participants