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

Incorrect value for is_active #54

Open
pocallaghan-function opened this issue Dec 5, 2023 · 0 comments
Open

Incorrect value for is_active #54

pocallaghan-function opened this issue Dec 5, 2023 · 0 comments

Comments

@pocallaghan-function
Copy link

Pretty sure this doesn't do what it was intended to. The bool cast applies to the left hand argument as opposed to the result of the comparison. In Magento a product has a status of 2 when it is explicitly disabled. In that instance this line essentially becomes:

$tmp['is_active'] = (bool) 2 == 1;

PHP will bool cast the 2 to be true in which case it's:

$tmp['is_active'] = true == 1;

Which is true.

The result of this is that every product that has a status explicitly set, regardless of enabled or disabled will return is_active = true.

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

No branches or pull requests

1 participant