Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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) {
Comment | File | Size | Author |
---|---|---|---|
#2 | required_multiple_values_check-1063954-2.patch | 1.19 KB | mediabounds |
Comments
Comment #1
okletsgo CreditAttribution: okletsgo commentedComment #2
mediabounds CreditAttribution: mediabounds commentedI 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.
Comment #3
fzipi CreditAttribution: fzipi commentedPatch from [#2] worked for me!