Cannot delete node if CCK required field is empty

morningtime - August 10, 2009 - 19:07
Project:Content Construction Kit (CCK)
Version:7.x-2.x-dev
Component:General
Category:bug report
Priority:normal
Assigned:Unassigned
Status:by design
Description

For example, I have a node with a CCK field "cost". This is set as a required field. But I uploaded items using NOde Import. Some nodes have empty cost field. Now, I want to delete the node with an empty required field, I am receiving the warning "Cost field must not be empty" etc. I think, when deleting nodes, it should not check any fields anymore. Just straight go to delete.

#1

markus_petrux - August 10, 2009 - 19:43
Status:active» by design

This is not a bug in CCK, but something related to how the node edit form works.

Try editing any non-CCK node, a page for example, leave the title empty (which is a required field), and then hit the delete button. You'll also get "Title field is required".

On the other hande, you can delete your nodes by directly invoking the path node/XX/delete.

If you have a lot of nodes to delete, you may want to write a small snippet like:

<?php
$nids
= array( /* list of nids to delete. */ );
foreach (
$nids as $nid) {
 
node_delete($nid);
}
?>

#2

mahfiaz - November 5, 2009 - 22:48
Version:6.x-2.5» 7.x-2.x-dev

It is also true for the d7 devel version. Maybe cck should drop the check on deleting. On the other hand, such nodes should really not be created on the first hand.

#3

yched - November 5, 2009 - 23:16

This is how Form API validation works in D6. No way around this.
There's an ongoing effort to fix this in D7: #370537: Allow Partial Validation of Forms (aka, make "more" buttons work properly), but this is not going to change in D6.

 
 

Drupal is a registered trademark of Dries Buytaert.