Jared Forsyth found that the Drupal 7 installation dies on some versions of MAMP (I think it was MAMP?) due to a form API error about passing values in by reference in call_user_func_array().

I'm really not sure why this error wouldn't occur for everyone (maybe it depends on PHP version?), but looking at http://us2.php.net/call_user_func_array, there does seem to be an issue due to the special behavior of this function:

mixed call_user_func_array ( callback $function , array $param_arr )
...
Note: Referenced variables in param_arr are passed to the function by a reference, others are passed by a value. In other words, it does not depend on the function signature whether the parameter is passed by a value or by a reference.

Very simple patch coming in a second :)

Comments

David_Rothstein’s picture

Status: Active » Needs review
StatusFileSize
new685 bytes

I don't have any great way to test this directly, but it seems like it should do the trick.

babbage’s picture

If someone can specify the version or setup of MAMP that D7 fails on (it doesn't on the current version of MAMP Pro) I'd be happy to test it...

jromine’s picture

I'm seeing the same issue on WampServer 2.0i. with PHP 5.3.0.

jromine’s picture

Patch works with WampServer 2.0i PHP 5.3.0.

jabapyth’s picture

The problem was actually on an XAMPP setup -- I actually switched over to DAMP and it worked fine ;) but i'll test this patch

senpai’s picture

Title: Drupal installation fails on some versions of MAMP due to pass-by-reference error » Drupal installation fails on MAMP & XAMPP due to pass-by-reference error

Changing the title. It's replicatable on both MAMP and XAMPP (linux mint).

senpai’s picture

Priority: Critical » Normal

Downgrading. It does not fail installation on MAMP PRO 1.7.2 It does fail on XAMPP 1.7.2 however.

senpai’s picture

Status: Needs review » Reviewed & tested by the community

Patch Testing Report

This patch was applied to an LA code sprint member's failing Drupal 7 installation running on a Win XP box under DAMP & WAMP. After the patch was applied, the user could successfully install Drupal 7. No negative effects or errors were noted during the install.

Summary

Working as intended; RTBC.

dries’s picture

Status: Reviewed & tested by the community » Needs work

Weird patch. I think this requires a code comment.

David_Rothstein’s picture

Status: Needs work » Needs review
StatusFileSize
new1.56 KB

Here it is with a code comment in install.php, as well as with a similar comment in the form API (where the same thing happens with $form_state).

After this is committed, we should either leave this issue open or create a new one, because it occurs to me that we might not be solving the "real" bug here. The bug that is being directly fixed here is really a pretty minor one - mostly it just leads to a PHP warning, I think. The real question is: Why does the Drupal installer completely die on a simple PHP warning (at least on some systems)?

salvis’s picture

Status: Needs review » Reviewed & tested by the community

#557358: Cannot install HEAD into an empty database marked as duplicate.

After installing the modules of the default profile I got:

Warning: Parameter 2 to install_configure_form() expected to be a reference, value given in drupal_retrieve_form() (line 450 of includes\form.inc).

XAMPP 1.7.2 (PHP 5.3.0, Apache/2.2.12 (Win32), MySQL 5.1.37), running on Windows 7 RC1 64-bit

This patch fixes the problem.

David_Rothstein’s picture

After a little further research, it actually seems like totally crashing the installer is the "expected" behavior here, due to the way PHP 5.3 works. For this particular type of warning message, PHP 5.3 also nulls out the variable that was incorrectly passed - see discussion at #360605: PHP 5.3 Compatibility - and that is obviously going to be catastrophic when the variable in question contains the entire state of the Drupal installation :)

So once this patch is committed, the issue can be closed after all, since the only Drupal-related bug is taken care of by the above patch.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Nice work on the code comments.

Committed to HEAD.

Status: Fixed » Closed (fixed)

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