Download & Extend

Cannot delete node if CCK required field is empty

Project:Content Construction Kit (CCK)
Version:7.x-2.x-dev
Component:General
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (works as designed)

Issue Summary

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.

Comments

#1

Status:active» closed (works as designed)

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

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

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 suppress of form errors (hack to make "more" buttons work properly), but this is not going to change in D6.

#4

Status:closed (works as designed)» active

#370537: Allow suppress of form errors (hack to make "more" buttons work properly) has landed and is now at "needs work" status for the addition of docs.

This issue will therefore probably be fixed by #216064: Delete button triggers form validation. Setting status back to active until this is confirmed.

#5

Status:active» closed (works as designed)

This is not a CCK issue, all the code in question is core code. The issue queue is overflowing already, we don't need issues about fixing core bugs.

#6

Fair enough, marking as dupe of #216064: Delete button triggers form validation.