I've added a Node Reference from URL CCK field to the Son content-type.

When I go to admin/content/node-type/son it says: To create a new Son, a referenced piece of content must be specified in the link you followed. And then: The requested page could not be found.

I've had to delete the field.

Please check it.

Comments

quicksketch’s picture

How were you able to delete the field if you couldn't access "admin/content/node-type/son"? If you were getting a page not found on node/add/son, this is intentional. If you want this page to work without a referenced NID, you can set the field to use the "Use select list widget" instead of "Display page not found error".

Antinoo’s picture

No, I'm not talking about node/add/son, I'm talking of admin/content/node-type/son.
I could delete the field since admin/content/node-type/son/fields was still reachable.

I've just tried for the 3rd time, with a new content-type, and I'm always getting that error: haven't you ever seen it?
If not, create a new content-type, eg. son, add a Node Reference from URL field to it, and then try to go to admin/content/node-type/son (the edit content-type form). I don't get the form showed. If you are getting it, I'll try with a Drupal fresh installation.

I'll try to look into the source code as soon as I have time to do it.

Greetings, Giovanni

quicksketch’s picture

I'm not able to reproduce this at all. Make sure you update to the latest 1.x development version before writing a patch, maybe this has already been fixed.

Antinoo’s picture

I've tried with a fresh D6 installation, and it works fine.
Looking at the backtrace, I've found that maybe there's a conflict between this module and Vertical Tabs one.

If I disable VT, I can access again to the admin/content/node-type/[node-type] page.

Still according to the backtrace, the VT module runs vertical_tabs_form_alter(), vertical_tabs_node_type_form() and drupal_prepare_form(), then the control is passed to CCK.

I don't have time at the moment to look deeper at the VT source code. I'll check in the next days.

Giovanni

Antinoo’s picture

Here it is the code I think generates the error (from vertical_tabs.module):

function vertical_tabs_node_type_form($node_type) {
  module_load_include('inc', 'node', 'node.pages');

  // Build a psuedo-node for a sample node form.
  $node = (object) array(
    'type' => $node_type,
    'name' => '',
  );

  // Build a sample node form to find fieldsets.
  $node_form_state = array('values' => array());
  $node_form_id = $node_type .'_node_form';
  $args = array(
    $node_form_id,
    $node_form_state,
    $node
  );
  $node_form = call_user_func_array('drupal_retrieve_form', $args);
  $node_form['#post'] = $node_form_state['values'];
  drupal_prepare_form($node_form_id, $node_form, $node_form_state);
  ...
quicksketch’s picture

Status: Active » Fixed
StatusFileSize
new995 bytes

This patch fixes the problem. The manual build process used by Vertical Tabs (and hopefully other modules) doesn't contain a form_build_id element, so we can check that this field exists before throwing an unnecessary page not found error.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.