Closed (fixed)
Project:
Devel
Version:
7.x-1.x-dev
Component:
devel_generate
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Sep 2012 at 11:23 UTC
Updated:
16 Oct 2012 at 18:51 UTC
Line #94 in devel_generate_image function contains assignment to an unused variable.
$images[$extension][$min_resolution][$max_resolution][$destination] = $destination;
$images is never used
I have attached a patch to remove the line.
Thanks,
nandiki
| Comment | File | Size | Author |
|---|---|---|---|
| remove-unused-line.patch | 574 bytes | nandiki |
Comments
Comment #1
salvisHave you checked the context where it was introduced? Was it used at the time. Maybe it was/is a debugging tool?
Comment #2
pcambraI was thinking this just today when dealing with devel images provider.
I tracked back this code to #687788: Support file and image fields in D7's devel_generate and this commit http://drupalcode.org/project/devel.git/commitdiff/d7d9a33508ed6e889514e...
$images is definitely used as there's this code
$file->fid = array_rand($images[$extension][$min_resolution][$max_resolution]);But that's in an else, inside this if there's no further use.
if (!isset($images[$extension][$min_resolution][$max_resolution]) || count($images[$extension][$min_resolution][$max_resolution]) <= DEVEL_GENERATE_IMAGE_MAX) {In any case, it's invoked as static
static $images = array();Comment #3
salvisThanks for tracking this down, pcambra.
Committed to D8 and D7, thanks for the patch, nandiki.