[drupal-devel] [bug] Image handling block on settings page provides no information if no toolkits are installed

TDobes drupal-devel at drupal.org
Wed Mar 23 23:41:13 UTC 2005


Issue status update for http://drupal.org/node/18093

 Project:      Drupal
 Version:      cvs
 Component:    system.module
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  Mad Maks
 Updated by:   TDobes
-Status:       active
+Status:       duplicate

I believe these issues have been adressed by this issue's patch [1].  If
not, feel free to reopen.
[1] http://drupal.org/node/18700


TDobes



Previous comments:
------------------------------------------------------------------------

February 28, 2005 - 03:28 : Mad Maks

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


------------------------------------------------------------------------

March 1, 2005 - 02:24 : Mad Maks

nobody?


------------------------------------------------------------------------

March 9, 2005 - 04:41 : Mad Maks

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


------------------------------------------------------------------------

March 19, 2005 - 14:25 : Junyor

Attachment: http://drupal.org/files/issues/system_5.patch (976 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.


------------------------------------------------------------------------

March 20, 2005 - 03:18 : Mad Maks

thanks


------------------------------------------------------------------------

March 21, 2005 - 15:26 : Dries

Committed to HEAD.


------------------------------------------------------------------------

March 21, 2005 - 22:29 : TDobes

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.


------------------------------------------------------------------------

March 22, 2005 - 01:49 : Junyor

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


------------------------------------------------------------------------

March 22, 2005 - 02:07 : Junyor

Attachment: http://drupal.org/files/issues/junyor.system.patch (927 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.


------------------------------------------------------------------------

March 22, 2005 - 02:31 : TDobes

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 [2], 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 [3]
[2] http://drupal.org/node/17477
[3] http://lists.drupal.org/archives/drupal-devel/2005-03/msg00915.html


------------------------------------------------------------------------

March 22, 2005 - 03:16 : Junyor

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:

Should the image_*_settings() hook be used to display settings for a
toolkit or tell if the toolkit is really enabled?
What should happen if there are no image handling settings?

Print a message on the settings page that no settings are available, or
Remove the image handling section from the settings page


What should happen if no image toolkits are installed/available?

Print a message on the settings page that no toolkits are available, or
Remove the image handling section from the settings page and print an
error in the watchdog log








More information about the drupal-devel mailing list