On one of my Drupal sites, the Image module stopped working completely; images are not displayed, entering descriptions results in errror message "you have to upload a picture", "Regenerate image thumbnails" claims to do something, but the image derivates are not available, in Image derivates, there is no "original size", configuration of the image subdirectory is ignored, etc.
Most notably probably: image paths point to wrong directories, e.g. ./system/files/images/image.jpg instead of ./files/images/image.jpg
Is there a way to reset the Image module completely to default values, or something like this? I tried to uninstall and reinstall the module, but had no luck (didn't change anything).
Regards, -asb
Comments
Comment #1
Hetta commentedYou need to add /system/ in front of all images in the drupal table files.
Comment #2
asb commented> You need to add /system/ in front of all images in the drupal table files.
Sorry, I don't quite understand; how do I accomplish this (some images have /system/ in their path), and why doesn't do the image module this?
If I'm looking into my Drupal database, ther is no table like "images" (just "image_attach"); where are image locations registered, and is there any technical documentation about the image module where I can look this up.
Additional annotations:
* Image descriptions can not be edited. If editind an image node where the image is displayed, the field "Image:" is empty. When trying to enter an image description and saving the node, the saves are denied with the error message: "You must upload an image". Directly below this error message, the thumbnail of the image is displayed.
* In the "image attachments" field of the node, images are *never* displayed. However, when clicking on the link provided after "This file can be found at...", an image *is* availabe for "_original", but not for "thumbnail".
Thanks & regards, -asb
Comment #3
Hetta commentedMysqldump the "files" mysql table, rename your original "files" table (in mysql) to, say, "files_bak" (I use phpmyadmin for that), update
', 'files/imagesto', 'system/files/images(using your text editor of choice), and import the newly changed "files" table to your drupal database.If you want to do the update without sql, that is.
Comment #4
asb commentedIf I change the path "files/images/image1.jpg" to "system/files/images/image.jpg", absolutely nothing is displayd anymore reminding of images; the image node can't be even displayed anymore.
Also, in my Drupal sites where the image module is still working properly, there is no "system" embedded into the paths.
Any other ideas?
Comment #5
Hetta commentedTry the various things here: http://drupal.org/node/184489
Comment #6
asb commentedThank you for the pointer. I ran the query
UPDATE files SET filepath = REPLACE(filepath, 'images', 'files/images') WHERE filepath REGEXP '^images';in MySQL on the "files" table, but it didn't change any records. When browsing through some entries with PhpMyAdmin, some paths do not point to ../images instead of ../files/images, but to ../files instead of ../files/images (I've no no idea how to fix this). Since admin/logs/page-not-found is still cluttered with broken image paths, pointing to system/files/images/; I tried to fix this manually, but had no luck (too many records to edit, derivated seem not to to be generated, etc.).
The main problem is still that entering descriptions results in the errror message "you have to upload a picture". That applies to all images ever uploaded. However, I can add an image description onece when uploading via node/add/image; still, descriptions can't be edited afterwards (this also applies to Image Attach uploads). I simply don't understand what is going wrong.
Regards, -asb
Comment #7
Hetta commentedFixing filepaths:
1) add "images" to all "/files/", including those which already are "/files/images":
UPDATE files SET filepath = REPLACE(filepath, 'files', 'files/images') WHERE filepath REGEXP '^files';
2) remove excess "files/":
UPDATE files SET filepath = REPLACE(filepath, 'files/files', 'files') WHERE filepath REGEXP '^images';
Comment #8
asb commentedHi Hetta,
I ran this queries:
The result:
* All images on the site are broken,
* absolutely no images are displayed anymore (except the site's logo),
* Image nodes still can't be edited
In the database table, now I have a mixture of paths like
* files/images/...
* files/images/images/...
After this, I disabled the "Image" module, re-enabled it, and reset it's configuration.
Then I tried:
Obviously this didn't work. Same with this:
Continue trial and error:
The result:
* In the database table, image paths seem to be cleared to files/images/...
* Some images on the site are broken,
* Some images are displayed,
* Image nodes can be edited again - WOW!
In more detail:
* In teaser view, thumnails are displayed
* in full node view, *no* attached images are displayed
* in image node, all derivates can be displayed
* in node edit view, in the fieldgroup "Attached Images" the thumbnails are displayed
* When selecting a node/image in admin/content/node, and choosing "Rebuild image thumbnails", Drupal reports: "The derivative images for ... have been regenerated". However, in the node view, still no prview image is displayed.
This was easy to fix in admin/content/types (the default values have different names for the preview images).
At the moment, everything related to images seems to work fine.
Thank you very much for the SQL statements!
Issue closed & greetings,
-asb
Comment #9
marchesinij commentedWe're using Drupal install with a 2 column layout template at http://www.gosocial.tv. We want to be able to add images to the right sidebar. We thought the best way to do this would be to use the Gallery module, which would allows us create a "Gallery block" on the sidebar. And then display a single image using the Gallery block.
The problem is that the Gallery block displays our image as a thumbnail. In addition, it's not even visible by anonymous users. What is the best way to display an image on sidebar without manually coding the image in? Do you recommend another module, aside from Gallery?
Comment #10
Hetta commentedThis issue is closed ... please create a new one, with the relevant data (feature request, version, priority,e tc.)