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 :)
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | install-state-by-reference-2.patch | 1.56 KB | David_Rothstein |
| #1 | install-state-by-reference.patch | 685 bytes | David_Rothstein |
Comments
Comment #1
David_Rothstein commentedI don't have any great way to test this directly, but it seems like it should do the trick.
Comment #2
babbage commentedIf 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...
Comment #3
jromine commentedI'm seeing the same issue on WampServer 2.0i. with PHP 5.3.0.
Comment #4
jromine commentedPatch works with WampServer 2.0i PHP 5.3.0.
Comment #5
jabapyth commentedThe problem was actually on an XAMPP setup -- I actually switched over to DAMP and it worked fine ;) but i'll test this patch
Comment #6
senpai commentedChanging the title. It's replicatable on both MAMP and XAMPP (linux mint).
Comment #7
senpai commentedDowngrading. It does not fail installation on MAMP PRO 1.7.2 It does fail on XAMPP 1.7.2 however.
Comment #8
senpai commentedPatch 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.
Comment #9
dries commentedWeird patch. I think this requires a code comment.
Comment #10
David_Rothstein commentedHere 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)?
Comment #11
salvis#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.
Comment #12
David_Rothstein commentedAfter 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.
Comment #13
webchickNice work on the code comments.
Committed to HEAD.