After upgrading to PHP 5.3, I get the following message on node/edit:
warning: Parameter 1 to theme_vertical_tabs() expected to be a reference, value given in /home/drupal/drupal-6.14/includes/theme.inc on line 617.

This complete breaks the display functionality of Vertical Tabs. When I fix the expected reference, all is well.

CommentFileSizeAuthor
expected_reference_value_given.patch567 bytesGrayside

Comments

avpaderno’s picture

Version: 6.x-1.0-beta4 » 6.x-1.x-dev

I can confirm the patch works.

I am not sure why the parameter is declared to be passed by reference, when the parameter is not modified.

/**
 * After build function to add vertical tabs JS and CSS to the form.
 */
function theme_vertical_tabs(&$form_element) {
  // Add Vertical Tabs JS and CSS.
  theme('vertical_tabs_js_css', $form_element['#vertical_tabs_js'], $form_element['#vertical_tabs_css'], $form_element['#vertical_tabs_settings'], $form_element['#form_id']);

  return '<div class="'. $form_element['#attributes']['class'] .'">&nbsp;</div>';
}
thekevinday’s picture

I agree with this patch and it does solve my problem.

With the drupal php 5.3 patches, the theme function now calls:

$output = call_user_func_array($info['function'], $args);

where it used to call

$output = call_user_func_array($info['function'], &$args);

Looking at the vertical_tabs code, the theme_vertical_tabs function still has its parameters passed by reference.

Looking into the vertical tab theme function, it does not seem to make any writes to the argument that is passed by reference.
Therefore, the above patch should be safe to apply for php-5.3 systems.

There is a problem with php 4.
The same exact issues are discussed here in the views project::
http://drupal.org/node/452384

This specific thread mentions the php 4 compatibility issue:
http://drupal.org/node/452384#comment-2097968

dave reid’s picture

Assigned: Unassigned » dave reid
dave reid’s picture

Status: Needs review » Fixed

Fixed in CVS (http://drupal.org/cvs?commit=285290). Thanks!

Status: Fixed » Closed (fixed)

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