This patch fixes the fact that empty rows are stored in the database when multi-field is chosen. If only one phone number is given, it is stored with an additional 2 blank fields. This is even more important if you include the patch to allow the user to select number of fields in the multi-field ( http://drupal.org/node/275837 ) - they could have up to nine blank fields then.

Comments

aren cambre’s picture

Title: Blank data is being stored in the database when you choose multiple. » Blank fields retained when you choose multiple
Version: 5.x-2.11 » 6.x-2.7
Priority: Normal » Critical
Status: Needs review » Active

This is still happening in 6.x. Changing to active since new patch is needed.

"Critical" because this is causing major data nastiness and wreaks havoc on views containing nodes with Phone (CCK) fields.

izarco’s picture

I solved the problem by changing the hook_content_is_empty

from:
function phone_content_is_empty($item, $field) {
return FALSE;
}

to:
function phone_content_is_empty($item, $field) {
if (empty($item['value'])) {
return TRUE;
}
return FALSE;
}

drewish’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new565 bytes

esezako's suggestion is the correct solution at least as far as CCK on D6 goes. Attached is a patch with the changes.

thierry_gd’s picture

Status: Reviewed & tested by the community » Fixed

Taken into account in 6.2.9 version

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.