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

handleIgnore function - variable type error #1

Merged
merged 1 commit into from
Sep 19, 2013

Conversation

drdrak3
Copy link
Contributor

@drdrak3 drdrak3 commented Sep 19, 2013

If (int)0 is used as a variable value in the $item array, the ignore function will unset it from the array.

Added a type check into the IF to remedy.

If (int)0 is used as a variable value in the $item array, the ignore function will unset it from the array.

Added a type check into the IF to remedy.
dweeves added a commit that referenced this pull request Sep 19, 2013
handleIgnore function - variable type error
@dweeves dweeves merged commit 1d05d39 into dweeves:master Sep 19, 2013
@dweeves
Copy link
Owner

dweeves commented Sep 19, 2013

Hmm strange , but switching operands do not work , identity is the only way to fix this,well done ! feel free to continue to contribute, your help is really welcome.

PatrickCronin added a commit to PatrickCronin/magmi-git that referenced this pull request Jul 30, 2014
This problem prevented me from performing a stock update using a fresh install of Magmi 0.7.19a on a fresh install of Magento CE 1.9.0.1. I created two simple products in Magento and tried to update their stock information them using Magmi. I created a two-column CSV ("sku" and "qty") and attempted to import it. I got the following errors:

1 SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'use_config_manage_stock' cannot be null -
2 SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'use_config_manage_stock' cannot be null - ERROR ON RECORD dweeves#1
3 SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'use_config_manage_stock' cannot be null -
4 SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'use_config_manage_stock' cannot be null - ERROR ON RECORD dweeves#2

More details on this error are here: https://sourceforge.net/p/magmi/discussion/1228365/thread/8e722889/

I tracked the problem to filterkvarr(). If the $kvarr has values which are numerical 0's, the function changes their values to null. This is because var_dump(0 == '__NULL__'); // 0 == 0 -> true. However, var_dump(0 === '__NULL__'); // 0 !== '__NULL__' -> false. So I suggest this change. (See PHP's documentation on this: http://us1.php.net/operators.comparison).
dweeves pushed a commit that referenced this pull request May 31, 2016
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.

None yet

2 participants