Wrong inclusion of utility.inc
suit4 - February 6, 2009 - 15:43
| Project: | Imagecache Actions |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
The inclusion of utility.inc in some of the modules seems to be problematic, as they are just included via
<?php
require_once('utility.inc');
?>but should be included like
<?php
require_once drupal_get_path('module', 'imagecache_actions') .'utility.inc';
?>otherwise there might occur an error.
Patches attached
| Attachment | Size |
|---|---|
| imagecache_canvasactions-includeFix.patch | 416 bytes |
| imagecache_coloractions-includeFix.patch | 402 bytes |
| imagecache_textactions-includeFix.patch | 512 bytes |

#1
Thanks. True enough, we are supposed to be more careful with our includes, although I've not found problems with this one so far.
I get the idea with the patches - although
- there is no actual 'imagecache_actions' module to lookup, so that would have failed.
- if successful, that require would have needed an extra '/' in the pathname.
Anyway, I'm pathing the affected files with the simple:
<?phprequire_once(dirname(__FILE__) .'/utility.inc');
?>
and all is cool.
Rolling soon when I add another feature (imagefield)
Thanks!
#2
Automatically closed -- issue fixed for 2 weeks with no activity.