Closed (fixed)
Project:
ImageAPI
Version:
5.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Aug 2008 at 15:08 UTC
Updated:
20 Jan 2009 at 00:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
webchickThis is happening because the hook_requirements() check is doing:
However, imageapi_get_available_toolkits() is defined in imageapi.module, which is not loaded at install time.
Comment #2
drewish commentedadding a test for runtime...
Comment #3
drewish commentedcommitted that to HEAD. needs to be backported to 5
Comment #4
waddles commentedAwesome, thankyou!
Comment #5
drewish commentedmarked #307753: I have PHP 5.2.5 but still get error as a duplicate
Comment #6
jrborba commentedTO AVOID HEADACHE!!!
On admin/build/modules, imagecache module, select only ImageAPI and ImageAPIGD2. Select "save configuration" and back again to imagecache module. Select Imagecache and ImagecacheUI. Select "save configuration". Voi lá !!! The message disappears.
Good while module don't be available updated. I'm so confused about patch listed.
Regards.
José Ricardo Borba
Porto Alegre - RS - Brasil
Comment #7
luckysmack commentedthis works...
But if not using GD2 library but you are using Image magick i still works if you enable before the cach and the UI.
Any news on getting this fixed by chance?
Comment #8
micheI tried enabling imageAPI first, as suggested above, but still received the error.
So, I applied the 6.x patch (comment #2) to the 5.x-1.x-dev version of imageapi.install and it worked.
Thank you.
Comment #9
mjlF95 commentedCould you elaborate on how to apply the patch?
Comment #10
micheIf you look at the above patch file, there are a bunch of pluses (+) and minus (-) in the left column. This indicates that lines either need to be added or removed.
This patch is quite simple.
Find the function:
if (count(imageapi_get_available_toolkits()) == 0) {
$requirements['imageapi_toolkits'] = array(
'title' => $t('ImageAPI Toolkit'),
'value' => $t('No ImageAPI toolkits available'),
'severity' => REQUIREMENT_ERROR,
'description' => $t('ImageAPI requires a Toolkit such as ImageAPI GD or ImageAPI ImageMagick to function. Goto !modules and enable one of them.', array('!modules' => l('admin/build/modules', 'admin/build/modules'))),
);
}
AND wrap it with if ($phase == 'runtime') { }
Good luck!
Comment #11
mjlF95 commentedThanks for the help. I couldn't do quite what you said because I couldn't find that same function. What I ended up doing was this. I looked in all files for something along the lines of "imageapi_get_available_toolkits". In the imageapi.module file I found:
/**
* Return a list of available toolkits.
*
* @return
* An array of the enabled image toolkit modules. The module name is the key
* and the value is a sub-array with the module's 'name' and 'description'.
*/
function imageapi_get_available_toolkits() {
static $toolkits;
if (!isset($toolkits)) {
$toolkits = array();
foreach (module_implements('imageapi_toolkit', true) as $module) {
$info = _module_parse_info_file(drupal_get_path('module', $module) .'/'. $module .'.info');
$toolkits[$module] = array('name' => $info['name'], 'description' => $info['description']);
}
}
return $toolkits;
}
I figured I'd go ahead and try the "wrap it with if ($phase == 'runtime') { }" fix you suggested and it seemed to work. Here is what I ended up with:
function imageapi_get_available_toolkits() {
static $toolkits;
if ($phase == 'runtime') {
if (!isset($toolkits)) {
$toolkits = array();
foreach (module_implements('imageapi_toolkit', true) as $module) {
$info = _module_parse_info_file(drupal_get_path('module', $module) .'/'. $module .'.info');
$toolkits[$module] = array('name' => $info['name'], 'description' => $info['description']);
}
}
}
return $toolkits;
}
Comment #12
SamRose commentedI don't know if this patch is correctly "backported" to D5, but it works with DRUPAL-5--1-3 (not currently an option in issue form ?!?)
Comment #13
drewish commentedthe indenting on the last patch seems pretty wonky... but can we get some reviews if it actually addresses the issue?
Comment #14
Rob_Feature commentedI'm not exactly sure which issue this patch (#12) was trying to address. However, I applied it hoping it would fix my issue, and it did. I was getting a white screen of death after attempting to install imageapi 5.x-1.x-dev and, after the patch, I no longer do. It installed successfully.
Comment #15
dopry commentedComment #16
HallSL commentedPatch in #12 worked for me.
Comment #17
drewish commentedCan someone roll one that comes with the comment?:
Comment #18
drewish commentedmarked #354719: Call to imageapi_get_available_toolkits() breaks install profiles as a duplicate.
Comment #19
drewish commentedCommitting the attached to DRUPAL-5.