Indirectory List Block Missing Images Cause Exceptions
Permalink Browser Info Environment
In all the templates used in the indirectory_list, there is code like this:
This simply doesn't work - if the image is missing, or the attribute is unset, an exception is raised. This is because isset() is testing whether $imageF is a defined variable which it is - you've just defined it. The fact that it's not a File object is much more useful - you should replace all instances of isset() with is_object() in all the templates. Doing that stops all the templates throwing exceptions f the image is missing.
$imageF = $cobj->getAttribute('logo'); if (isset($imageF)) { $image = $imgHelper->getThumbnail($imageF, 200, 120)->src; }
This simply doesn't work - if the image is missing, or the attribute is unset, an exception is raised. This is because isset() is testing whether $imageF is a defined variable which it is - you've just defined it. The fact that it's not a File object is much more useful - you should replace all instances of isset() with is_object() in all the templates. Doing that stops all the templates throwing exceptions f the image is missing.
Type: | Ticket |
---|---|
Status: | Resolved |