When updating field_collection from 1.0b8 to 1.0b9 with drush, the update fails:

Drush command terminated abnormally due to an unrecoverable error.                                      [error]
Error: syntax error, unexpected T_FUNCTION in
/home/jrdev/public_html/sites/all/modules/field_collection/field_collection.module, line 591
Parse error: syntax error, unexpected T_FUNCTION in /home/jrdev/public_html/sites/all/modules/field_collection/field_collection.module on line 591The external command could not be executed due to an application error.                                 [error]
Backups were restored successfully.     

Inspecting the file in question, looks as if line 591 contains a missing ")" for array_filter:

$all_boolean = $instances && !(bool) array_filter($instances, function ($instance) {

should be

$all_boolean = $instances && !(bool) array_filter($instances, function ($instance)) { .

Patch attached.

Comments

mef613 created an issue. See original summary.

mef613’s picture

Status: Active » Needs review
StatusFileSize
new1.18 KB

Patch attached.

Status: Needs review » Needs work

The last submitted patch, 2: field_collection-2597215-D7.patch, failed testing.

sagar ramgade’s picture

It seems you are using php 5.2 or lower which doesn't support closures (http://culttt.com/2013/03/25/what-are-php-lambdas-and-closures/), I think it is better to mention php = 5.3 in .info file.

sagar ramgade’s picture

Status: Needs work » Needs review
tobiasb’s picture

Status: Needs review » Closed (duplicate)
Related issues: +#2598926: Unexpected T_Function