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

add check empty array in optimizer preview and code optimization #1425

Merged
merged 3 commits into from
Jul 8, 2019
Merged

add check empty array in optimizer preview and code optimization #1425

merged 3 commits into from
Jul 8, 2019

Conversation

androshchuk
Copy link
Contributor

fix for #1418

$config = $this->optimizer->getQuickSearchContainer();
if ($config['apply_to'] == 1) {
if ($config['apply_to'] === 1) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Beware with strict comparison here. Could be '1' and not 1 when fetched from DB. If you wanna strict-check, I'd go for if ( (int) $config['apply_to'] === 1) to be really sure.

$config = $this->optimizer->getCatalogViewContainer();
if ($config['apply_to'] == 1) {
if ($config['apply_to'] === 1) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as previously

@romainruaud romainruaud merged commit b39afe4 into Smile-SA:2.8.x Jul 8, 2019
@androshchuk androshchuk deleted the 1419-fix-error-in-optimizer branch August 1, 2019 09:05
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