Dev date 2010-Jul-11

I'm importing data and one of the fields is a CCK Textfield Textarea with Multiple values. Fails on line 554 in node_import.admin.inc because $values['map'][$fieldname] is only checked as a string. Multi-CCK field values return array.

I don't know if this is the best solution but its what got me by.

Line 554 node_import.admin.inc

	  $isEmpty = FALSE;
	    switch(gettype($values['map'][$fieldname]))
		{
			case 'string': $isEmpty = strlen($values['map'][$fieldname]) == 0; break;
			case 'array': $isEmpty = strlen(implode(",", $values['map'][$fieldname])) == 0; break;
		}
        if ($fieldinfo['map_required'] && $isEmpty) {
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

okletsgo’s picture

Title: CCK Multiple values » CCK Multiple values empty check
mediabounds’s picture

Status: Active » Needs review
FileSize
1.19 KB

I ran across this same issue today and instead patched it by simply checking if the value was an array before checking the string length; I'm making the assumption that if the value is an array then it is not empty.

fzipi’s picture

Status: Needs review » Reviewed & tested by the community

Patch from [#2] worked for me!