Instead of checking for the file with if (!$file) should be used if (!isset($file)) in FeedsEnclosure::getFile() otherwise we get the notice: Undefined variable: file FeedsParser.inc:388.

Files: 
CommentFileSizeAuthor
#5 feeds-FeedsParser-isset-file-2053355-5.patch817 bytesufku
PASSED: [[SimpleTest]]: [MySQL] 5,934 pass(es).
[ View ]
#1 feeds-FeedsParser-isset-file-2053355-1.patch472 bytesosopolar
PASSED: [[SimpleTest]]: [MySQL] 4,507 pass(es).
[ View ]

Comments

osopolar’s picture

Status:Active» Needs review
StatusFileSize
new472 bytes
PASSED: [[SimpleTest]]: [MySQL] 4,507 pass(es).
[ View ]

The patch to fix this.

osopolar’s picture

osopolar’s picture

Issue summary:View changes

add function name FeedsEnclosure::getFile()

twistor’s picture

Issue summary:View changes
Status:Needs review» Fixed

Status:Fixed» Closed (fixed)

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

ufku’s picture

Status:Closed (fixed)» Needs review
StatusFileSize
new817 bytes
PASSED: [[SimpleTest]]: [MySQL] 5,934 pass(es).
[ View ]

This is still an issue when getContent() method throws an exception. Moreover, file_save_data() can return FALSE which passes isset() check.

The patch initiates the $file as NULL and reverts the change by #1.

vinmassaro’s picture

Status:Needs review» Reviewed & tested by the community

Running the latest dev release, I was seeing this notice. The patch in #5 fixes the notice for me. Thanks!

  • twistor committed 22a29c4 on 7.x-2.x authored by ufku
    Issue #2053355 by ufku, vinmassaro: Notice: Undefined variable: file...
twistor’s picture

Status:Reviewed & tested by the community» Fixed

Status:Fixed» Closed (fixed)

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