Closed (fixed)
Project:
Yelp
Version:
7.x-2.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
13 Feb 2014 at 00:35 UTC
Updated:
20 Feb 2014 at 14:14 UTC
Jump to comment: Most recent
I'm getting the following PHP warning:
Strict warning: Only variables should be passed by reference in yelp_api_replace_token() (line 22 of yelp_api.tokens.inc).
Apparently PHP does not like the way that array_shift is used in the following line:
$type = trim(str_replace('[', '', array_shift(explode(':', $token))));
I added an @ to quiet the warnings on my system, but the line should probably be rewritten. For now, here's the modified line:
$type = trim(str_replace('[', '', @array_shift(explode(':', $token))));
Comments
Comment #1
mikemiles86Thanks you for pointing this issue out. If you could, submit a patch (https://drupal.org/node/707484) and I'll take a look at implementing it.
Comment #2
mikemiles86Using @ to supress the error is not the correct approach to solve with issue (it only stops PHP from reporting it). I'll take a look at rearchitecting this part of the module to fix the pass by reference issue. Thansk for reporting it!
Comment #3
mikemiles86Comment #4
mikemiles86I can confirm this bug, and have patched it. The fix will be included in the next release (7.x-2.4).
Thanks again for reporting it.
Comment #5
mikemiles86