Closed (fixed)
Project:
Commerce Shipping
Version:
7.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Dec 2011 at 23:17 UTC
Updated:
6 Jan 2012 at 10:50 UTC
Upgrade via Drush:
Fatal error: Can't use method return value in write context in /var/www/drupal/sites/all/modules/contrib/commerce_shipping/commerce_shipping.install on line 152
Error: Can't use method return value in write context in /var/www/drupal/sites/all/modules/contrib/commerce_shipping/commerce_shipping.install, line 152
Any ideas
Comments
Comment #1
3rdLOF commentedI got temporary workaorund for this problem so I could get the site back up and running. Basically on line 153 of commerce_shipping.install
emptyappears to be used improperly according the PHP.net manual (http://us3.php.net/empty):if (empty($line_item_wrapper->commerce_shipping_service->value())) {So I modified the code by adding a variable declaration to collect the contents, then called it like so:
I made no patch because I have no idea if this is the correct approach, but the error disappeared and the install process did complete. So far no problems I can see.
Please check this. This is only a temporary patch because this error WOD'ed everything...even Drush.
Comment #2
rei commentedI also got this error when enabling the module
Comment #3
googletorp commentedYeah, this is my bad. Sometimes I forget you can't use wrapper values with empty
Anyways, I replaced empty with ! and pushed the fix to the 2.x branch.