Hello,

I'm trying to create a photo gallery. After creating its content type and the image presets, when I'm adding a new content node and therefore, adding images to the node it gives me an error, that keep appearing on pages:

Strict warning: Only variables should be passed by reference em file_file_download() (linha 164 de C:\xampp\htdocs\modules\file\file.module).

What's wrong?

CommentFileSizeAuthor
#1 fix_strict_error.patch652 bytesBerdir
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

Status: Active » Needs review
FileSize
652 bytes

Not much wrong, just a e_strict warning. I guess I added that line ;)

Try the attached patch.

Berdir’s picture

Title: Attaching images to node gives error in File module » E_STRICT warning when downloading/viewing a file or image
xpound’s picture

Eureka! :P Thanks!

marcingy’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me

webchick’s picture

Is there a way to trigger this warning from an automated test?

tstoeckler’s picture

Either enabling E_STRICT errors, which was dismissed for D7 I think, or installing PHP 5.3.

Berdir’s picture

Testbots are already running PHP 5.3

Enabling E_STRICT however is not possible, unless we want to enforce E_STRICT compatibility for all contrib modules as well. Which I think we can not. That was already tried for D7 and quickly reverted.

catch’s picture

Version: 7.0 » 8.x-dev
Issue tags: +Needs backport to D7
Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x and 8.x. Thanks Berdir.

bfroehle’s picture

Issue tags: -Needs backport to D7

Untagging since it's been committed to 7.x

Status: Fixed » Closed (fixed)

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