This function in optimizely.admin.inc need to be changed.

/**
 * Menu callback. Get confirm to delete a record from the Optimizely table.
 */
function optimizely_delete_page($form, &$form_state, $vars = NULL) {
  return drupal_build_form('optimizely_delete_page_confirm', &$form_state);
}

It should be

/**
 * Menu callback. Get confirm to delete a record from the Optimizely table.
 */
function optimizely_delete_page($form, &$form_state, $vars = NULL) {
  return drupal_build_form('optimizely_delete_page_confirm', $form_state);
}

Basically remove the ampersand from within the function call for $form_state

I would patch the code but I just submitted another patch before this that affects the same file.

Comments

DeeZone’s picture

Assigned: Unassigned » DeeZone
Status: Needs review » Closed (works as designed)

Check out http://api.drupal.org/api/drupal/includes!form.inc/function/drupal_build.... drupal_build_form() passes $form_state by reference > &$form_state. For more details on passing by reference, checkout: http://php.net/manual/en/language.references.pass.php

DeeZone’s picture

Status: Closed (works as designed) » Needs work

Ooops, just saw the title of your ticket "Call-time pass-by-reference in a function call needs changed as it's deprecated in newer PHP" and found the related comment in the PHP docs:

Note: There is no reference sign on a function call - only on function definitions. Function definitions alone are enough to correctly pass the argument by reference. As of PHP 5.3.0, you will get a warning saying that "call-time pass-by-reference" is deprecated when you use & in foo(&$a);. And as of PHP 5.4.0, call-time pass-by-reference was removed, so using it will raise a fatal error.

DeeZone’s picture

Status: Needs work » Fixed
DeeZone’s picture

Status: Fixed » Closed (fixed)