Reordering albums: empty $this->unique set is empty

I recently upgraded from 1.1.6 to 1.3 via a convoluted process. The main reason was because I had albums all over the place and wanted a neater structure with subalbums, which wasn't possible with the older version. However, when trying to save my restructured albums, I get the error: empty $this->unique set is empty

Possibly this is symptomatic of deeper problems with the installation but since I literally upgraded it a few minutes ago and it was my main reason for doing so, I haven't encountered anything else yet, and can therefore only assume that it's the only problem right now. Any hints?

Comments

  • Huh. I noticed something else, I seem to have lost all of my metadata (comments, descriptions) for all of my albums and photographs. This may be a seperate problem related to the upgrade process or database credentials, but I thought I'd note it just in case.
  • The error you got is from a core part of zenphoto. It is really hard to say what might cause it since it is one of those "this cannot happen" type errors.

    Anyway, going from 1.1.6 to 1.3 is a pretty large leap. It is quite possible that changes along the way are not propegated when skipping so many releases.

    I would suggest you start again. This time make each upgrade in turn--that is run the setup process for each interim release level.

    While it is certainly likely that you do not have to do this for each and every level, there is no way for us to be sure which ones are going to be required.

    You can find all the old versions here
  • Sorry, I wasn't clear enough - I upgraded from 1.1.6 to 1.2.4, then to 1.2.5 and thence 1.3 (hence the "convoluted process", the steps were on advice from another question I had in this forum, regarding core changes within ZP). Everything seemed to be fine until this last step.
  • That does not change my answer.
  • Okay, I grabbed all the versions and, having restored my database from a backup, proceeded to try upgrading from 1.1.6 to 1.1.7 and thence through the other versios. Sadly I didn't get further than this, as the upgrade to 1.1.7 presented me with a screen to change admin usernames and passwords, but doing so output the following error:

    `MySQL Query ( UPDATE ``zp_administrators`SET `name`='blah' ,`password`='blah', `email`='blah', `rights`='16447' WHERE `id`='1' ) Failed. Error:Unknown column 'password' in 'field list'

    Returning to the gallery gives errors:

    `Warning: copy(/home/www/vhosts/site.net/httpdocs/zenphoto/albums/multimediaDefault.png) [function.copy]: failed to open stream: Permission denied in /home/www/vhosts/site.net/httpdocs/zenphoto/zp-core/controller.php on line 14`

    `Warning: copy(/home/www/vhosts/site.net/httpdocs/zenphoto/albums/zen-logo.jpg) [function.copy]: failed to open stream: Permission denied in /home/www/vhosts/site.net/httpdocs/zenphoto/zp-core/controller.php on line 15`

    `Warning: Cannot modify header information - headers already sent by (output started at /home/www/vhosts/site.net/httpdocs/zenphoto/zp-core/controller.php:14) in /home/www/vhosts/site.net/httpdocs/zenphoto/index.php on line 21`

    `Warning: Cannot modify header information - headers already sent by (output started at /home/www/vhosts/site.net/httpdocs/zenphoto/zp-core/controller.php:14) in /home/www/vhosts/site.net/httpdocs/zenphoto/zp-core/functions.php on line 1668`

    I would really love to just skip this and start anew with the most recent version, but I have so many albums and photos with so many comments written to them that I don't want to lose all that work. Any ideas?
  • acrylian Administrator, Developer
    As a quick answer: The first error is probably because 1.1.7 did not have the rights management as we have it now (don't remember right now when that was introduced at all).

    As the other error indicates your file/folder permissions are somehow wrong.

    I have to leave the more proper answers this to sbillard for later as he is the architect of the install script.
  • Okay, thanks for the reply anyway. Curious that I can't upgrade cleanly from 1.1.6 to 1.1.7.

    As to the permissions, 'albums' has permissions 777 (drwxrwxrwx) so should be writeable for the script to copy files from zp-core, so I can't understand why that doesn't work. As for 'Cannot modify header information', I have no idea there at all...
  • Rename the "pass" table entry in your administrators table to "password". Somehow things are really messed up in your database. Hope that this is the only issue.

    Regarding the second issue, check you file permissions. Apparently zenphoto is not allowed to open that file.
  • Thanks for that reply; I had already fixed the other errors (by deleting the original two image files and allowing the installer to recreate rather than overwrite), but databasey-type stuff is rather out of my area. I'll have a go at changing that field and see how I get on. I had no problems until I attempted the upgrade originally, hopefully this is the only thing...
  • Curiouser and curiouser. I fixed that field and everything seems to be okay. I moved to 1.1.7 and now I get an interesting effect. The albums themselves and the admin stuff all seems fine, but where the viewer comments box begins, there are some hundred or so lines reading "Warning: Division by zero in /home/www/vhosts/site.net/httpdocs/zenphoto/zp-core/lib-encryption.php on line 20".
  • Well, apart from that one problem, it was going okay up to 1.2.3, which calls setup.php just fine, and then expires with "`Fatal error: Class 'utf8' not found in /home/www/vhosts/filecore.net/httpdocs/zenphoto/zp-core/functions-basic.php on line 29`" when I put my db info into zp-config.php.
  • Are you still getting the Division by zero? That is somehow being caused by the captcha handling. But no clue as to what could be going on.

    As to the "Class 'utf8' not found..." maybe there was some problem with the upload. The line just before it should load the library which defines that class. You can try re-uploading the files and see if that fixes it.

    In short, it really seems your installation is pretty screwed up.

    Probably it would be a good idea for you to start on the task of placing your image descriptions within the actual image file metadata. Album descriptions could be placed within an XMP file of the same name as the album. At least then if this ever happens again the data will be preserved.
  • I'm no longer getting `Division by zero`, I guess an upgrade fixed that. `Class 'utf8' not found` was avoided by skipping just that one release, and proceeding directly from 1.2.2 to 1.2.4. After this, I have made it so far to 1.2.9 - other errors have been cropping up too, but believe it or not I'm handling most of them myself (simple stuff like permissions, corrupt or incompletely uploaded files, and so on).

    Edit: hmm. I got it to 1.3.0 and it works and most stuff seems okay, but now I'm getting `empty $this->unique set is empty` again! Back round in a gigantic loop right to my original problem again :-) I'll drop back to 1.2.9 for the time being, and call it quits since it's coming up for 1am in my time zone... thanks anyway for all the help so far.
  • Well, if you get to a stable 1.2.9, use the backup utility to make a backup of your database. Then at least you will be able to preserve your descriptions. (Some other things might not transfer up, depends on what changes there were to the database between 1.2.9 and 1.3.1)

    That way you can try a new install and database restore. Of course I would suggest doing that on a trial installation first!
  • Probably should have thought of this earlier, sorry.

    Please change the line in functions-basic.php which defines DEBUG_ERROR.
    `define('DEBUG_ERROR', !defined('RELEASE')); // set to true to supplies the calling sequence with zp_error messages`

    to

    `define('DEBUG_ERROR', true)); // set to true to supplies the calling sequence with zp_error messages`

    This will tell us the call history leading up to the error. Maybe that will tell us what is wrong.
  • Yep, I used the backup/restore when migrating. It seems to drop tables relating to exif data when moving up from 1.2.x to 1.3.x, but nothing I can't live without.

    Testing an install of 1.3.1, it passes the tests in setup.php but when I got to upgrade I get a variety of errors along these lines: `Zenphoto encountered an error: MySQL Query ( UPDATE``zp_administrators` SET `name` = 'group', `rights` = '1968526677', `custom_data` = 'Users with full privileges', `valid` = '0' WHERE id=21; ) failed. MySQL returned the error Duplicate entry '0-administrators' for key 2.

    From what I can tell (and looking at what happens in that table in phpMyAdmin), it's just creating duplicate entries for 'administrators' rather than updating the existing ones, and then having a problem with the duplicates. It's also doing this for the 'viewers' entry. I can refresh the database view after the attempted upgrade and see the new entries; I'm not sure why it's doing this. I have tried deleting the new entries, deleting the existing entries, and deleting both entries. No difference.

    Interestingly, the old entry contains the correct information while the newly-created duplicate contains NULL for all fields.

    EDIT: Since deleting one entry (eg, 'administrators') led to an error with the next ('viewers'), I then experimented with deleting them both. The next error was with 'Bozos', and so I deleted all entries except the superuser with my own username. Bingo! All of them were recreated without flaw and I now appear to have a working 1.3.1. There is only one problem, which ironically is the thing that I began this whole upgrade process for in the first place - moving albums into other albums ('sort album' in the root zenphoto folder) doesn't work. Saving them just gives me the 'Saved' message but returns the album structure back to what it was.

    I suppose this is probably an issue of permissions with the server and zp not being allowed to restructure the physical folder arrangement, but I'm out of ideas with it. Everything else works though, which I suppose is a good thing.
  • This is a known issue of "jump" migrations. It has also been fixed in the nightly builds. However, what you did it the work-around, so you should be good to go.

    As to the album move. You might give the nightly build a try since you are so close to it.
  • Okay, I'll give that a go and see what happens. Either way, it's working (at least as much as it always was, even if I can't get the new things like album move working right) so at least it's up and running for the viewers. Great software, by the way - my own problems nonwithstanding, I've been recommending it since 1.1.6 and I continue to do so even now :-)
  • Hmm, the latest nightly (23-08-10) doesn't seem to work at all for reordering albums, I'll take the previous nightly and work my way backwards...

    EDIT: actually, none of the Ajaxy-type backend stuff works, dragging and dropping images also.
  • Are you getting javascript errors? Those things work for me.
  • acrylian Administrator, Developer
    Maybe that is related to the jQuery issue we had with 1.2.9(?). jQuery 1.4.2 broke our drag & drop sorting because an dependencie on an older plugin. It was downgraded to 1.4.1 with 1.3 (I think...). Maybe that got lost with all that testing.
Sign In or Register to comment.