Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comment | File | Size | Author |
---|---|---|---|
#1 | cck_form_invokation.patch | 725 bytes | gerd riesselmann |
Comments
Comment #1
gerd riesselmann CreditAttribution: gerd riesselmann commentedAttached 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.
Comment #2
yched CreditAttribution: yched commentedOK, sorry for the delay.
You have that code in userreview_form :
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 ?
Comment #3
yched CreditAttribution: yched commentedCommitted (with a different flag name) to 1.x-dev branches. This will be in 1.6.
Comment #4
(not verified) CreditAttribution: commentedComment #5
land0 CreditAttribution: land0 commentedI 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