Blank fields retained when you choose multiple
liveoutloud2day - June 27, 2008 - 18:45
| Project: | Phone (CCK) |
| Version: | 6.x-2.7 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Description
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.
| Attachment | Size |
|---|---|
| phone.module.blank_.data_.diff | 714 bytes |

#1
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.
#2
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;
}
#3
esezako's suggestion is the correct solution at least as far as CCK on D6 goes. Attached is a patch with the changes.
#4
Taken into account in 6.2.9 version
#5
Automatically closed -- issue fixed for 2 weeks with no activity.