When I try to go to

/admin/content/node-type/project-issue

It redirects me to node/add/project-issue

Am I not supposed to be able to edit project issue content types?

Thanks.

Comments

dww’s picture

Status: Active » Closed (works as designed)

It works fine for me (no redirect) on my test site and here on drupal.org. Must be something screwy with your setup. Make sure you're running the latest code in HEAD (which includes some file reorganization, so if you're updating from CVS, use "cvs up -dP"), clear your menu cache, etc.

juhaniemi’s picture

I'm having the same issue.

Checked that I have the latest 6.x-1.x-dev.
Tried reinstalling the module but still keeps redirecting.

dww’s picture

Category: support » bug
Status: Closed (works as designed) » Active

I just saw this bug in the wild. I still can't reproduce it locally at all, which sucks. But, I think it's a real bug. I definitely do not understand it yet. This makes no sense at all.

dww’s picture

Assigned: Unassigned » dww

Yay, I can finally reproduce this locally. The problem is Vertical tabs. If you disable that, everything works.

The bug is that vertical_tabs is doing some very unholy things. In vertical_tabs_form_alter(), if it sees you're trying to use a node type form (e.g. /admin/content/node-type/project-issue), and if so, it does the following:

  // 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);
  uasort($node_form, 'element_sort');

However, the project_issue node form is expecting a valid project to be selected, since it's sort of a multi-page form thanks to #199138: Remove multipage form for issue nodes. So, when the form builder doesn't see a valid project, it assumes you landed on the 2nd page by accident or malice without a valid project, generates a drupal_set_message() about it, and redirects you back to the first page. Therein lies the problem here.

Not sure if this should be considered a bug in vertical_tabs, project_issue, or both. :(

dww’s picture

Title: Can't edit content type » /admin/content/node-type/project-issue redirects to node/add/project-issue due to vertical_tabs
dmitrig01’s picture

Status: Active » Closed (duplicate)
dww’s picture

Status: Closed (duplicate) » Active

Not true. That patch doesn't solve this problem at all. Please read comment #4 closely. This has nothing to do with the form being #programmed or not.

dmitrig01’s picture

never mind

dmitrig01’s picture

Project: Project issue tracking » Vertical Tabs
Component: Issues » Code

This is a vertical tabs issue. The current way vertical tabs works is it builds the node form, finds all fieldsets on it, and puts them into checkboxes, on the node type form. #320475: Configure which fieldsets are rendered as vertical tabs - no one ever got a chance to review the patch, that's probably why it slipped through. There should be some other way than building the node form. This also doesn't account for multi-step forms.

dww’s picture

Title: /admin/content/node-type/project-issue redirects to node/add/project-issue due to vertical_tabs » Vertical tabs fieldset configuration breaks horribly for multi-step node forms
Assigned: dww » Unassigned

More accurate title, and unassigning myself.

greggles’s picture

So, how do we solve this? If it's not an easy fix please consider #577266: visiting node admin screen invokes hook_form (and shouldn't).

dave reid’s picture

Status: Active » Postponed (maintainer needs more info)

Can someone test using the latest code (6.x-1.0-beta6) now that it is using a pre_render callback on the form instead of using form_alter?

dww’s picture

Status: Postponed (maintainer needs more info) » Active

I can now visit /admin/content/node-type/project-issue on my site and it doesn't break horribly. And the content type fieldsets are vtabs now. ;) But, I no longer see any UI for #320475: Configure which fieldsets are rendered as vertical tabs -- where does that live? That seems like the thing that's still going to break with multi-step node forms...

dave reid’s picture

Darn I was hoping to respond to you on IRC. Basically there are two ways to control vertical tabs. The first is through our beloved $conf in settings.php. The other is by using Form controller. See #644790-7: Simplify the module and integrate with form_controller to allow customizations for more details.

dww’s picture

Status: Active » Fixed

Yup, all working now. Thanks!

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Status: Closed (fixed) » Active

Hi, sorry for opening this up, but what is the current solution to use Vtabs + project issue? I tried latest dev snapshot, but you still cant edit the project-issue type.

Was there any progress on this?

a.ross’s picture

As a side-note, the Module Filter (http://drupal.org/project/module_filter) module uses vertical tabs (without depending on the module, apparently).

Edit: removed module_filter entirely and updated Issue Tracker to 1.x-dev, problem persists! Also, disabling Issue Tracker and then Enabling it again triggers a prompt to also enable Comment Upload. Comment Upload is enabled, so the prompt doesn't display as it should.

schultetwin’s picture

This may have been fixed in beta6, but comes back in rc1 and rc2. drupal_retrieve_form, and drupal_prepare_form are stilled called to find fieldsets for that form, which in turn breaks multistep node forms, such as project issue.

richardp’s picture

Yeah, sorry for re-opening, but I can confirm this is still happening in RC2. Can't use vertical tabs with project_issue.

xaa’s picture

subscribe

a.ross’s picture