Update fails, hack makes it work, but continued problems.
bwooster47 - April 26, 2008 - 21:52
| Project: | Acidfree Albums |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Upgrading 4.7.6 to 5.7, acidfree datestamp = "1207008007"
Update failed. Says function not found (acidfree.module line 963).
Found that class_album.inc has _album_from_tid($tid), so copied that to acidfree.module.
This allowed upgrade to proceed, no errors reported in log.
But - no images were migrated, no albums were migrated.
Any one have any thoughts on what to try next?

#1
Redid the upgrade, this time prepared acidfree.module beforehand - renamed its function _album_from_tid so it would not clash even if class_album.inc was included, This made the upgrade work.
But now have many other problems:
0) Biggest problem: there seems to be a disconnect between acidfree and image module on the sizes of images. In 4.x, a "preview" image was shown which led to the "original" image. In 5.x, I only see the preview image in the picture window, and it is not clickable, so the original image is never seen. More seriously - visiting some albums seems to cause image module to spew messages like: "The derivative images for ... have been regenerated.". This is very CPU intensive operation, and ends up getting killed all the time on my web host. Given that all image sizes exist, there should be no need to regenerate anything!
1) Album view shows very thin, tall windows into the thumbnails.
div class="acidfree-cell"><div class="acidfree-item acidfree-folder"><div class="acidfree-thumbnail" style="width: 172px; height: 132px;"the thumbnail sizes above are correct, but the acidfree-item seems to be something thin and very tall, and acidfree-cell shows up as a very small section of that.
So, only get a peek at the top-left corner of the actual image thumbnail.
2) inline filter fails - it gets the link correct, but then it adds this to the img tag:
class="acidfree-plain " width="0" height="0" style=""which of course results in 0 width image, so nothing is seen on the page.
Logs show a divide by 0 error at line 1990:
$f_dim = getimagesize($filepath);
if (!$f_dim)
return "<span style='color: #f00;'>{$matches[0]}</span>";
$f_width = $f_dim[0]; $f_height = $f_dim[1];
if ($aspect < $height / $width) { // line 1990
3) if I edit an image node, I see a new field in the edit window, titled: "Image" - stating I should Click Browse and select image to upload. But the image has already been uploaded, back in Drupal 4.x this field was not shown, so it was possible to keep the old picture and just edit the title/description/categories. More importantly, since the image may have been uploaded a while ago, there is no local file available to upload - this would not be possible in most cases. So, is there now no way to re-edit an previously uploaded image node, without re-uploading the photo?
Some of these issues may be image module related, have tried to separate them in this issue: http://drupal.org/node/251872
#2
Re-did the update (with the fixed acidfree.install mentioned above).
But - started with image-5.x-1.2.tar.gz instead of 1.8
Had the same problems as above.
Then moved to image-5.x-1.6.tar.gz , following image module upgrade instructions (re-run update.php before looking at any image node).
Everything seemed to look fine now. But image sizes are not correct - because during the update I think acidfree gets the values incorrect. and changing them means rebuilding all derivative images!
Also: image module is serving original image as binary octet stream :-( I see files named file_64 (instead of file_64.jpg?) and file_64.thumbnail.jpg... arrrghhhh....
Following does not work:
1) start with 1.6. same problem - acidfree unable to get image sizes, and grid/cells are tall/thin.
Update to image-1.8 does not fix this issue. Both these versions also rebuild all derivative images.
So, don't have the right image module version to start with. If anyone knows which version of acidfree works with which version of image, let me know!
#3
Most of the key issues were related to image module.
After fixing them (see linked image issue in previous comment), I was able to first install image-1.8 for Drupal 5.x, got it working, and then updated acidfree module. After the fix to acidfree.module mentioned above (comment #1), update succeeded.
#4
Automatically closed -- issue fixed for two weeks with no activity.
#5
Well, after months I tried to upgrade again - still no luck.
The first problem mentioned in this issue is still present - upgrade fails due to missing function.
Using latest dev snapshot
132767 Nov 1 18:00 acidfree-5.x-1.x-dev.tar.gz
Get this error on running update.php:
Fatal error: Call to undefined function _album_from_tid() in /.../public_html/test.514/sites/all/modules/acidfree/acidfree.module on line 963If you see this error, the db is now corrupt (or at least acidfree is in a bad state) - re-running update even after fixing above problem will not move over the acidfree items to image modules, etc.
You have to go back to a previous backup, fix the error, and run update again.
Here's the hack fix part of that:
// hack - copied from class_album.inc to make update.php workfunction _album_from_tid($tid) {
$nid = _nid_from_tid($tid);
if (!$nid) {
return null;
}
return acidfree_get_node_by_id($nid);
}
But this hack has to be undone immediately after update.php is done, before going to any other page.
#6
I spoke to soon - the fix works for a few seconds, but then get this error:
Fatal error: Cannot redeclare _album_from_tid() (previously declared in /home2/aczoomco/public_html/acplace/test.514/sites/all/modules/acidfree/acidfree.module:2794) in /home2/aczoomco/public_html/acplace/test.514/sites/all/modules/acidfree/class_album.inc on line 655So basically this is now an infinite loop - first get an error function is not defined, and after defining it, get a error later saying it is defined - all in the same update.php execution.
And a correction to above back - _nid_from_tid should be expanded.