I have more than 4000 nodes of images with five sizes each. When upgrading from Drupal 4.7.10 to 5.5, I needed to upgrade the image.module. When running the update, it appears that it times out. Maybe, after peeking at the code in image.intstall, function update4, I see that it places the sql queries into an array() called $ret and sends it somewhere else for execution. When running this update, the mysql process consumes 98% of the cpu, so I think it is getting some of the changes. Yet, it times out before it can get to the end of the update via update.php. Here is the error message:
The update process was aborted prematurely while running update #4 in image.module. All other errors have been logged. You may need to check the watchdog database table manually.
Afterwards, when viewing the image nodes as a Web page, via http://www.website.com/node/1029, for example, the image and all sizes appear normally.
However, when accessing just the particular image, eg http://www.website.com/image/view/1029/quarter, improper headers are handed off to the browser, and I see binary code, not an image.
Furthermore, the Watchdog error message appears for every image on a page, for example (I have images from nodes embedded into the body of the CCK, calling them via e.g.
) gives this error:
Invalid argument supplied for foreach() in /home/swtexas/public_html/sandbox/includes/file.inc on line 551.
Help appreciated.
- Is there a way to run this update from the command line and move on?
- is there any other way to update the image module with this many image nodes?
Using image-5.x-1.x-dev
Comments
Comment #1
jghyde commentedI fixed it by looking at another site I had running Drupal 5 with the Image module.
Here are the steps:
1. Since the update.php was hanging on "update4," I commented out all of the function update4 on image.install file, except the function itself. In other words, I made it an empty function.
2. The update4 was basically updating files to make the column "filepath" be a more complete file path. It was changing all filepath to files/images/... from smply images/...
To update the database, I used the following command in myPhpAdmin"
That updated the images in the files table.
All works well now.
Comment #2
jtrant commentedthis sql statement was just what i needed to resolve broken images after a 4.7 to 5.2 upgrade. some of the names in file were updated, but not all of them.
thanks.
jt
Comment #3
Cynthia Ewer commentedAnother user with the same problem.
Thanks! That fixed my issue of seeing binary code instead of images in the "view original image" feature.
Comment #4
Hetta commentedComment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
v8powerage commentedI'm just trying to update this bloody thing and I got this message:
* The original image size was missing so no changes were made. See this image module issue for more information. Include the following:
Array
(
[0] => Array
(
[label] => thumbnail
[operation] => scale
[width] => 320
[height] => 320
[link] => 0
)
[1] => Array
(
[label] => preview
[operation] => scale
[width] => 640
[height] => 640
[link] => 0
)
)
* user warning: Table 'image' already exists query: CREATE TABLE image ( `nid` INTEGER UNSIGNED NOT NULL, `fid` INTEGER UNSIGNED NOT NULL, `image_size` VARCHAR(32) NOT NULL, PRIMARY KEY (`nid`, `image_size`), INDEX image_fid(`fid`) ) /*!40100 DEFAULT CHARACTER SET utf8 */; in /home/unitra/htdocs/new/includes/database.mysql.inc on line 174.
What shall I do next?
Comment #7
Hetta commentedSee http://drupal.org/node/158334#comment-1331132 .