See the attached screenshot. On the content type edit form, I cannot select which fieldsets should be rendered by Vertical tabs. To notice that there is a module that actually add a fieldset in the node edit form.

As side note, I also get the following error message, in the content type edit form:

warning: Parameter 2 to drupal_retrieve_form() expected to be a reference, value given in /Library/WebServer/Documents/dr61/sites/all/modules/vertical_tabs/vertical_tabs.module on line 163.
CommentFileSizeAuthor
Voila_Capture_49.png22.96 KBavpaderno

Comments

avpaderno’s picture

I forgot to say I am using the development snapshot from November 7; if the code has been already changed, and I need to wait 1 hour to get the new archive, then I apologize for this report.

avpaderno’s picture

The line for which the error is report is contained in the following function:

function vertical_tabs_node_type_form(&$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' => '',
    'vid' => 0,
  );

  // 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');

  // Find all fieldsets.
  $fieldsets = array();
  foreach (element_children($node_form) as $key) {
    if (isset($node_form[$key]['#type']) && $node_form[$key]['#type'] == 'fieldset' && isset($node_form[$key]['#title'])) {
      $fieldsets[$key] = $node_form[$key]['#title'];
    }
  }

  $form['vertical_tabs'] = array(
    '#type' => 'fieldset',
    '#title' => t('Vertical tabs'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#description' => t('The selected fieldsets will be rendered as vertical tabs for this content type. The tabs are rendered in the same version as the original form\'s fieldsets.'),
  );
  $form['vertical_tabs']['vertical_tabs_fieldsets'] = array(
    '#type' => 'checkboxes',
    '#options' => $fieldsets,
    '#default_value' => vertical_tabs_fieldsets($node_type),
  );
}

The line that causes the error I reported contains $node_form = call_user_func_array('drupal_retrieve_form', $args).

As last note, I am having the issue on Mac OS X 10.6, which runs PHP 5.3.0.

dave reid’s picture

Assigned: Unassigned » dave reid

This is a PHP 5.3 error. I'm going to replace this with a direct call to drupal_retrieve_form($node_form_id, $node_form_state);

dave reid’s picture

Status: Active » Fixed

Fixed in CVS. Thanks!

Status: Fixed » Closed (fixed)

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

fenstrat’s picture

Version: 6.x-1.x-dev » 6.x-1.0-rc1
Status: Closed (fixed) » Active

Same php 5.3 error again with rc1

warning: Parameter 2 to drupal_retrieve_form() expected to be a reference, value given in .../vertical_tabs/vertical_tabs.admin.inc on line 45.

This happens on admin/content/types/content-type after enabling the option "Expose vertical tabs selection on the edit content type forms."

dave reid’s picture

My apologies for the regression. I had used the wrong revision when re-adding the node type form options. I'll get it fixed today.

dave reid’s picture

Status: Active » Fixed

Fixed back in CVS and will be available in the next release.
http://drupal.org/cvs?commit=326420

Status: Fixed » Closed (fixed)

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

bstoppel’s picture

This problem still exists with RC1. When will a new RC be available? It's been about a year since the first release candidate.

john franklin’s picture

The patch should also remove the $args = array(...) just above the call as it is now dead code. I'd also like to request a new RC (or better yet, full release) be published.

wiifm’s picture

Also keen to see a new RC, will save me running more dev code ;)

timb’s picture

BUMP Dev code fixed the problem for me.

wiciu’s picture

PHP 5.3.4 (cli) (built: Dec 11 2010 17:46:49)

And still error:
Parameter 2 to drupal_retrieve_form() expected to be a reference, value given w pliku /home/xxx/public_html/modules/vertical_tabs/vertical_tabs.admin.inc, linia 45.

realityloop’s picture

Status: Closed (fixed) » Active

Confirming dev fixes the issue on PHP 5.3.2

realityloop’s picture

Status: Active » Closed (fixed)

oops accidentally changed status