file: image.effects.inc

Though not leading to any error or warning messages, there is no need to pass the image objects by reference. The pass by reference is not repeated in functions called by the ..._effect functions in this file and the ..._effect functions don't replace the image object themselves. (In PHP5 you can change the properties of objects passed by value and that is what's happening here.)

So strictly speaking perhaps no error, but this practice seemed to have trickled down to contributed modules (http://drupal.org/node/818798#comment-3917226), so better remove it.

Comments

aspilicious’s picture

Version: 7.0 » 8.x-dev

Line numbers are appreciated.

fietserwin’s picture

Status: Active » Needs review
StatusFileSize
new2.89 KB

All appearances. See attached patch.

Status: Needs review » Needs work

The last submitted patch, remove-reference-1021738-2.patch, failed testing.

fietserwin’s picture

Status: Needs work » Needs review

#2: remove-reference-1021738-2.patch queued for re-testing.

I can't discover any relationship with this patch and the failed test (testNodeQueryAlterOverride).

rasmusluckow’s picture

#2: remove-reference-1021738-2.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, remove-reference-1021738-2.patch, failed testing.

rasmusluckow’s picture

Status: Needs work » Needs review
StatusFileSize
new2.97 KB

I have re-rolled this patch in order to make it work with HEAD.

lucastockmann’s picture

Status: Needs review » Needs work

The last submitted patch, remove-reference-1021738-7.patch, failed testing.

rasmusluckow’s picture

Status: Needs work » Needs review

#7: remove-reference-1021738-7.patch queued for re-testing.

michaellenahan’s picture

#7: remove-reference-1021738-7.patch queued for re-testing.

fietserwin’s picture

Looks good to me, but I'm probably not allowed to RTBC just by myself.

scottelundgren’s picture

patch conforms to coding standards & function calls are changed from pass by reference to pass by value. Applied the patch to an 8.x development site, created an image style to use all the functions the patch mentioned, created a content node to use the image style and no errors occurred.

aspilicious’s picture

Status: Needs review » Reviewed & tested by the community

#7: remove-reference-1021738-7.patch queued for re-testing.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Looks like this doesn't break any of the existing tests, so...

Committed and pushed to 8.x. Thanks!

xmacinfo’s picture

Status: Fixed » Needs work

We need a git commit --amend here. Commit message was left blank. :-)

http://drupalcode.org/project/drupal.git/commit/2784b6a

webchick’s picture

Status: Needs work » Fixed

Sadly, git commit --amend doesn't work on d.o, because you can't change a commit once it's been pushed. :(

But I did revert and re-commit it w/ the correct message. Thanks.

Status: Fixed » Closed (fixed)

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