Running PHP 5.5.17 I get the following strict warning:

Strict warning: Only variables should be passed by reference in commerce_add_to_cart_extras_handler_field_quantity->views_form_submit() (line 172 of docroot/sites/all/modules/contrib/commerce_add_to_cart_extras/commerce_add_to_cart_extras_handler_field_quantity.inc).

On line 172:

$path = 'node/' . array_shift(array_keys($result['node']));

The array keys must be set to variable and that variable is then passed in like so:

$array_keys = array_keys($result['node']);
$path = 'node/' . array_shift($array_keys);
unset($array_keys);

Comments

capellic’s picture

Patch attached.

blasthaus’s picture

Nice but would it not be better to use reset($array_keys); rather than array_shift ?

joelpittet’s picture

Status: Active » Needs work

@blasthaus yes, want to post that as a patch? Also there is some whitespace issues with the patch.

blasthaus’s picture

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

Ok here you go.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

Nice, thanks @blasthaus

joelpittet’s picture

Status: Reviewed & tested by the community » Fixed

I forgot someone gave me commit access to this:) Committed to -dev thanks @blasthaus and @capellic

  • joelpittet committed c3199fb on 7.x-1.x authored by blasthaus
    Issue #2530136 by capellic, blasthaus: Only variables should be passed...

Status: Fixed » Closed (fixed)

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