i have installed the cvs version yesterday (upgrade from 4.5.2) and now i see at administration => settings a block with the titel image handeling. But in that block there is nothing except a "1" . Is this a now bug or did i do something wrong?

greetings

MM

CommentFileSizeAuthor
#8 junyor.system.patch927 bytesjunyor
#3 system_5.patch976 bytesjunyor

Comments

Mad Maks’s picture

nobody?

Mad Maks’s picture

BrianH has posted a screenshot in http://drupal.org/node/18588

junyor’s picture

Title: imagehandeling block on settings page is (almost) empty. » Image handling block on settings page provides no information if no toolkits are installed
Component: base system » system.module
StatusFileSize
new976 bytes

I think the problem is that no image toolkits are installed at your host. Here's a patch that should clean up things a bit by adding information if no toolkits are available.

Mad Maks’s picture

thanks

dries’s picture

Committed to HEAD.

TDobes’s picture

Forgive me if this is totally incorrect, but...

A cursory glance at this patch seems to indicate that it's not the correct fix. The image_toolkit_invoke('settings') only gets called if there is more than one toolkit. What if there's only one toolkit installed and it has settings available?

Also, the else clause is encountered if the number of toolkits is not greater than one (in other words: less than two). The else clause tells the user that there are NO toolkits. Isn't this message inaccurate if there's only one toolkit? For that matter, won't there always be at least one toolkit because we bundle one in image.inc?

If we've decided that there will never be any settings from the core toolkit, perhaps we should just change the text to read "There are no extra toolkits installed, so image manipulation will be done using gd2." or something like that. From a user's perspective, the "no toolkits" message would be interpreted as "you can't manipulate images", which is not the case.

Feel free to correct me if I'm wrong here... I haven't yet thoroughally looked over the image handling code.

junyor’s picture

@TDobes: You're correct, it's the wrong fix. I'm looking into it again now.

junyor’s picture

StatusFileSize
new927 bytes

OK, the problem seems to be that image_gd_settings() returns TRUE. So, if there's only one toolkit installed, you'll just see "1" in the image handling section on the settings page. I had thought that "image_toolkit_invoke('settings')" was supposed to show settings for an image toolkit, not verify that the toolkit is installed.

Here's a new patch that corrects the problem in the first patch. If only one toolkit is installed and working, it prints a message saying the toolkit is ready for use. If no toolkits exist, the same message as in the previous patch is printed.

If no message should be printed if no settings are available (only one toolkit is installed or no toolkits are installed), I can roll another patch.

TDobes’s picture

I was under the same impression as Junyor that toolkits were supposted to have a settings hook such that there might be a unified place for configuration. (i.e. location of binaries if one is using imagemagick)

Perhaps walkah (who wrote the image.inc code IIRC) could clarify on this?

It looks like the problem was introduced by this patch, which is where the idea seems to have originated that the settings hook might be used to determine whether a toolkit exists or not. My guess is that we need to remove the "return true" from image_gd_settings and instead return a message like "You are using the GD toolkit, which has no configurable settings." or something along those lines. This would avoid breaking the check for toolkit existance based on the settings hook while fixing the problems it caused.

See also: Stefan's UI consistency comments

junyor’s picture

Yep, that looks like the place this problem started. A settings function should return available settings, not tell whether the functionality is really available.

I'm setting this back to active, as there are a couple things that need to be decided before we can precede:

  1. Should the image_*_settings() hook be used to display settings for a toolkit or tell if the toolkit is really enabled?
  2. What should happen if there are no image handling settings?
    1. Print a message on the settings page that no settings are available, or
    2. Remove the image handling section from the settings page
  3. What should happen if no image toolkits are installed/available?
    1. Print a message on the settings page that no toolkits are available, or
    2. Remove the image handling section from the settings page and print an error in the watchdog log
TDobes’s picture

I believe these issues have been adressed by this issue's patch. If not, feel free to reopen.