I'm a Drupal noobie so I know I've done something wrong, but for the life of me I can't figure out what. In the end, the symptoms can best be described as if the image module has somehow been hijacked out of no where, and in my extremely limited understanding of how Drupal functions, it is as if all of the hook functions have been commandeered.

The initial symptom that I noticed was that the random image block was no longer displaying an image. When I then went to load individual image nodes, I discovered that images wouldn't display on the image node, and that the image wouldn't show up if I tried to edit the image node either. My first thought was that the images themselves had disappeared, or that access permissions had changed, but no, everything is fine there, and in fact, images that have been hardcoded onto a page from the image directory show up fine. My second thought was that the image associations in the database had been corrupted, but as near as I can tell everything was fine there (my limited understanding again hampering me, but at a minimum, the node table shows an image node as an image node, and the files table is showing the correct thumbnail, preview, & _orginal file associations with the proper nodes).

I then went to create a new image node, and that is when things started getting wierd to me (to my noobie definition of wierd). On the create content page, the help text for create image has disappeared. On the node/add/image page, the form for submitting an image is now missing the fields for the image title, uploading the image, and the body field. The only sections displayed on the form are for Groups, Authoring, and Publishing options. PHP generates an error message for array_merge_recursive(), argument #2 is not an array, in node module line 1610 (Drupal V4.7.3).

Next, I go to check the module settings on admin/settings/image, which produces a blank page instead of settings, and the PHP error message "Missing argument 2 for drupal_get_form() in form.inc on line 61. OK, so I then try to uninstall/reinstall the module. In the process of doing so, I note that on the modules page, the text for image, image_attach, and image_gallery are all now missing. Uninstalling those three modules, and deleting the entire directory structure for module/image (which includes image_attach and image_gallery), I then notice that those modules are STILL included on the module page! Why?? Every time I've deleted the physical module files, the modules have disappeared from the module page! Curiosity having the best of me at this point, I decide to reinstall the modules from the module page, even though the physical files themselves have beend deleted. No error messages are generated!?!?!?! How? The files have been deleted!?! OK, check the settings. The image settings page creates the same blank page/PHP error message. What is really wierd (to me) is that the settings page for image_gallery still allows me to set the images per page, even though the image gallery module code has been deleted!! Finally, reloading the image module (and associated image_gallery/image_attach), yields no changes to any of the above.

From my perspective, everything was working fine, and then wham!, suddenly the above symptoms occur. The day before the symptoms appeared, I had installed CCK and the associated modules for CCK fields (including image field) and contemplate. I'm wondering if contemplate may be related to the issue, but I have not used any of the contemplate functionality other than to click on a template tab to see the options provided by contemplate. Uninstalling contemplate had no effect either. Furthermore, I'm 99% certain that the issue didn't manifest itself until much later...

Searching for similar issues, I see that others have indicated prior problems with disappearing images, thumbnails, etc, but nothing about the entire module, so my impression is that something else is going on here. Short of a complete reinstall, I don't have a clue as to how to proceed to resolve this issue...

HELP! (please!)

G^2

Comments

gsquared’s picture

It is nice when I can answer my own question for a change, albeit with significantly less hair that what I started out with.

It was clear that the image module wasn't uninstalling like I thought it should have. When I first started using Drupal, I had investigated the necessary steps to remove a module. I thought that the only steps that are required to remove a module are to 1) deactivate the module from admin/modules, 2) delete the modules files, 3) delete any database tables created by the module, and 4) delete any variables created by the module in the variable table. A more recent post indicated that you must also delete the module's entry in the system database table.

Investigating the system table, I discovered that there was strangely another version of the image module contained under the directory structure of the phone field module of CCK. As it turns out, I had indeed installed the phone module before the image module problem began, but assumed that there couldn't possibly be any relationship between the two (after all, how could a phone field in CCK have anything to do with the image module!?!?!). Careless me had assumed that the phone module installed just like all of the other field modules for CCK, and simply copied the phone directory over and activated the module.

As it turns out, the most recent release of the phone module contained a modules subdirectory that also included not only a copy of the image module that was overwriting my install, but also a version of addtofavorites, sin (SSN#), zipcode, and yet another version of the phone module itself. I have submitted an issue for this.

I guess some lessons have to be learned the hard way...

toptom1’s picture

Hi, I had the same problem and it seems that your solution has worked up to a point for me. I have now regained access to the image module but now when I go to the image settings page, above the actual settings, there is a warning:

"Make sure you have a working image toolkit installed and enabled, for more information see settings"

Did you get this too? and if so how did you rectify it?

Can anyone else who may have had this too shed any light?

By the way - I think it's a bit rude what the phone module did!

gsquared’s picture

Tom,

I'm probably the last person you want to help as I'm not only new to Drupal, but also to PHP. However, I looked thru the code and did an online search, and this is what I understand:

The image modules require an image toolkit running on your server in order to manipulate the images. The message you refer to is generated by _image_check_settings() in image.module when image_get_toolkit() (found in includes/image.inc) fails to find an image toolkit. The default toolkit is the GD library, which comes bundled with Apache, and you may need to activate it either in your httpd.conf or php.ini files (see this thread). I'm not aware of anything from the faulty phone field install that would have affected your PHP settings; unfortunately, however, I've already deleted the faulty phone field install files, so I wasn't able to go back and look for anything specific there...

Were you per chance using the imagemagick toolkit? The image module includes provides an include file for imagemagick.

The function image_get_toolkit() checks for a configuration variable image_toolkit for the name of a toolkit, and then looks for an include file in the includes directory for that toolkit. If image_toolkit is set to imagemagick, then image_get_toolkit() looks for and includes the file image.imagemagick.inc from your includes directory. I'm not sure of the "proper" way to set configuration variables, which are stored in the variable database table. However, one way to set the configuration variable image_toolkit is in your settings.php file in the variable overides section at the bottom of the file. While I haven't tested this myself, based on the above, I believe that your image module will make use of imagemagick if you 1) copy the file image.imagemagick.inc from your image module directory to your includes directory, and then 2) set the configuration variable image_toolkit to the value imagemagick.

There is also an Imagemagick module that was developed with the Summer of Code project, but I haven't checked into it, and do not know what the relationship is between that module and the include file provided with the image module.

Perhaps a guru can correct any errors in my response and provide better guidance...

G^2

toptom1’s picture

Hi,
Thanks for that info - I don't quite know how it happened but the GD library in my PHP had diabled itself or uninstalled itself and I'm not too sure how it could have done this. It was working before the phone module and then checking phpinfo told me that it wasnt there anymore. So i've re-enabled it and hey presto it works again - thanks. Maybe that phone module has a few more questions to answer than just messing up drupal - I have to check through my server now - although i don't quite know how it could do any damage. Thanks again anyway.
Tom

stanbroughl’s picture

thanks! i got rid of the modules hidden in the phone module and i'm back to my normal settings now.

Cheers!