-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Add failsafe to items.phtml #13086
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
Add failsafe to items.phtml #13086
Conversation
We got a warning that $exist is undefined - not entirely sure what the exact scenario was but adding this as a failsafe. Added as default fallback and 'other'.
break; | ||
|
||
default: | ||
$exist = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than adding the default options here what about adding an isset
check as part of the if wrapping the content display.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed as requested. Your suggestion is a neater solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed the extra declarations for $exist and have added an isset check to the if statement as requested.
break; | ||
|
||
default: | ||
$exist = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed as requested. Your suggestion is a neater solution.
@samgranger thank you for the quick update. I will process this pr now. |
This should work if the variable is set And the variable is true or 1 or greater
Description
We received a warning that $exist is undefined - not entirely sure what the exact scenario was but adding this as a failsafe.
I have made sure that $exist is defined (null) in the 'default' and 'other' case.
Contribution checklist