Closed (fixed)
Project:
ImageCache Actions
Version:
7.x-1.x-dev
Component:
Canvas Actions Module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Feb 2011 at 14:56 UTC
Updated:
19 May 2012 at 13:40 UTC
Hi, I tried to put a canvas action to a preset and I got a blank page. The logs said the following:
PHP Fatal error: Call to undefined function imagecache_rgb_form() in /whatever/web/sites/default/modules/imagecache_actions/canvasactions/canvasactions.inc on line 67, referer: http://whatever/admin/config/media/image-styles/edit/galleryformatter_slide
I've fixed it adding this code to canvasactions.inc:
if (! function_exists('imagecache_rgb_form') ) {
module_load_include('inc', 'imagecache_actions', 'utility-color');
}
Comments
Comment #1
dman commentedYeah, something like that was needed.
Should be ok in 7.x-1.x-dev
Comment #3
alan d. commentedLooks like someone removed this again. I haven't check git to see the status (dev is older than the release)
I would just use this prior to the load:
Mmmm... looking through the code, it looks like you are doing a code order via mixed loads:
Since these are effectively unconditionally loaded on every page load, direct includes would be cleaner:
In imagecache_actions.module
etc
Or move to a lazy loaded function. No need for special drupal static includes.
Or a third option use hook_hook(), but test - this hook fails on the field hooks as these are not real hooks. This could be a really nice way of including / encapsulating the style definitions.
Comment #4
dman commentedYeah. At some point when migrating a bunch of the utilities out into inc files I lost track of the dependencies.
At first each of the action bundles were their own modules, but later they needed to share some libraries that no one module owned.
That's where the conditional checking started, as you may have module A, module B or both enabled.
Anyway, that started getting silly, so I introduced 'imagecache_actions' as a core dependency module that doesn't actually do anything but act as a dependency for the actual actions and provide the libraries.
Also as I split one of the packages (text) off into a separate project but it still wanted to use library functions from this group.
Some of the code in some places hasn't been fully ported to that way of thinking I guess.
Some refactoring is needed indeed.
Comment #5
dman commentedAs imagecache processing is a relatively rare event in the lifetime of a website, I was trying not to get all the library processing functions bootstrapped every pageload - so lazy-loading is certainly what we should aim for.
Comment #6
bryancasler commentedJust reporting that I'm having this same problem when I'm trying to use "Define Canvas"
Comment #7
bryancasler commented*Marking as active*
Comment #8
Bogdan Balan commentedSame issue with 7.x-0.0 on Drupal 7.12
Comment #9
lastar84 commentedSame here with 7.x-0.0 on Drupal 7.12
But updated to 7.x-1.x-dev on Drupal 7.12 and did not have this issue.
Comment #10
fietserwinIt is indeed fixed in 7.x-1.x-dev.