Imagecache v2 api changes - Fatal error: Call to undefined function _imagecache_get_presets()

Alan D. - June 8, 2008 - 02:53
Project:Teaser Thumbnail
Version:5.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Just helping someone on the forums and recommended this

Edit teaserthumbnail.module, about line 20

<?php
 
// We build a clean array of the presets namespaces to store the preset
  // itself and not its key
 
$presets = _imagecache_get_presets();
?>

to

<?php
 
// We build a clean array of the presets namespaces to store the preset
  // itself and not its key
 
$func = (function_exists('imagecache_presets')) ? 'imagecache_presets' : '_imagecache_get_presets';
 
$presets = $func();
?>

Fully untested, as I haven't a D5 local install with the required modules

#1

antipix - June 26, 2008 - 09:54

does this solution work for someone ?
with this fix i can go on teaser thumbnail settings page but all settings are empty...

#2

sakib000 - July 22, 2008 - 12:04

same problem here, every field is empty

#3

hunvreus - July 25, 2008 - 09:11

I never used Imagecache 2 but will have a look at the new api soon. I've got already to upload the latest version with view support and will make sure to make it follow by an Imagecache 2 compatible version.

#4

MetalicusKhan - August 11, 2008 - 13:55

change (line 22):

  $presets = _imagecache_get_presets();
  $presets_clean = array();
  foreach($presets as $preset) {
    $presets_clean[$preset] = $preset;
  }

to:

  $presets = imagecache_presets();
  $presets_clean = array();
  foreach($presets as $preset) {
    $presets_clean[$preset[presetname]] = $preset[presetname];
  }

#5

hunvreus - January 14, 2009 - 11:18

This is fixed but not committed yet: I need first to finish the views support.

#6

hunvreus - January 24, 2009 - 18:21

The latest version is being committed: support for ImageCache 2, as well as Views and RSS.

#7

hunvreus - January 24, 2009 - 18:22
Status:active» fixed

#8

hunvreus - January 26, 2009 - 20:57
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.