I'm doing some content importing using the node import module in drupal. My problem is that I'm getting errors on data that looks like it should be working smoothly. This is the code at issue:
if (count($allowed_values) && !array_key_exists($item['value'], $allowed_values)) { //$allowed_values[$item['value']] == NULL) {
print "||||" . $item['value'] . "||||";
print_r($allowed_values);
And this is a sample of what is printing:
||||1||||Array ( [0] => no [1] => Zicam® Cold Remedy Nasal Gel Spray Single Hole Actuator (“Jet”) ) ||||1||||Array ( [0] => No [1] => Yes )
It looks to me like it's saying that "1" is not in the array, when printing the way "1" is clearly visible. If I replace the existing module code with the commented out check, no error is thrown.
itemandallowed_values?iteman actual array? The docs for array_key_exists say it no longer works properly for object for PHP 5.3. What was avar_dump()of$item['value']and$allowed_valueslook like? print_r is nice for content, but var_dump also reports type/size information.