Within function content_admin_field_overview_form(), content.module invokes node_form(). Some modules may disable node_form, so does userreview (http://drupal.org/project/userreview), whioch I maintain. This leads to a situation where a field can be added but fields cannot be managed (see http://drupal.org/node/145679).

I suggest to add a special field to indicate that node_form has been invoked by content.module by adding a property _invoked_by_cck like this:

 // Create a dummy node and form and call hook_form_alter()
  // to produce an array of fields and weights added to the node by all modules.
  $dummy_node = new stdClass();
  $dummy_node->type = $type['type'];
  $dummy_node->_invoked_by_cck = true; // NEW! This indicates a CCK invoke
  $dummy_form_id = $type['type'] .'_node_form';
  $dummy_form = node_form($dummy_node);

What do you think?

CommentFileSizeAuthor
#1 cck_form_invokation.patch725 bytesgerd riesselmann
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gerd riesselmann’s picture

Priority: Normal » Critical
Status: Active » Needs review
FileSize
725 bytes

Attached the according patch, which needs to be applied to content_admin.inc.

I increased priority to "critical", since this is a blocker for a bug in userreview.

yched’s picture

OK, sorry for the delay.

You have that code in userreview_form :

if (!is_numeric($node->content_id) || !$node->vote_tag) {
    drupal_goto('userreview/howto');
}

I guess you could add a check there to test if the current path starts with 'admin/content/types/' (D5) or 'admin/node/types/' (D4.7) ?
Well, I'm not that fond of the fix you propose, but i'm not sure mine is actually better...

Let's consider this a couple days and then fix it one way or the other ?

yched’s picture

Status: Needs review » Fixed

Committed (with a different flag name) to 1.x-dev branches. This will be in 1.6.

Anonymous’s picture

Status: Fixed » Closed (fixed)
land0’s picture

I tried replacing content_admin.inc from the /cvs/cck/drupal5Branch. I still cannot manage the cck field for userreview. Granted I may be missing something... :p