Can't sort or edit albums with over 64 images

For some strange reason I'm having a problem with albums containing over 64 images - once I add the 65th I'm unable to edit the sort order or save any changes (titles/descriptions) when I click on Save on the Edit Album page. This particular install is hosted on a Small Orange. I have several Dreamhost installs that don't have this problem. Any ideas? I'm guessing it might have something to do with MYSQL, but I don't even know where to begin looking if that's the case.

Thanks for any help!

Comments

  • trisweb Administrator
    Hmmmm... that's an interesting one. Why don't you submit this on Trac, it'll be easier to keep track of there. Thanks!

    To start, I'm guessing there's a limit somewhere, yeah. Ask a small orange if they have any limits on PHP array sizes, or on resultsets from MySQL.

    Also, I'd love to see the output of a `phpinfo();` attached to that bug. Also elaborate on what you mean by "stops working" -- what exactly happens? Thanks!
  • Oops - I should've elaborated a bit more. By "stops working" I mean that, on clicking Save, I end up with a blank page (http://myurl.com/zenphoto/zen/admin.php?page=edit&action=save). View Source shows nothing at all for that page. So instead of being taken back to the album list I've got this blank page instead. But only when I hit a certain number of images. It does this when clicking on Save at the top of the page (if you're changing the sort order, for example) or at the bottom of the page (if you're editing titles/descriptions for the individual images).

    I'll look into the small orange side of things. I have a feeling the problem might lie with them. I just setup a stock install with no tweaks, no url rewrites, etc. on a brand new database and I have the same problem.

    The PHP info for my server can be viewed here - http://colleen.asmallorange.com/phpinfo.php

    Thanks again!
  • trisweb Administrator
    Bingo. Looks like you've got a "security hardened" version of PHP there, from some project called "Suhosin". It limits the number of items in a request array, which Zenphoto uses for sumbitting image information from the forms.

    `suhosin.request.max_array_index_length 64 64`

    Either ask your host to disable this weird extension, or to increase that to... well... the maximum number of images you'd want in an album...
  • trisweb Administrator
    It'd be good to note too that I should keep the array size under that anyway in the future; it's probably not good practice to send a gigantic POST back to the server when it's not necessarily required. Also, the edit pages should be paged, and the arrays could easily be split and recombined on the server without too much work. I'll look into that.

    Submitting this to Trac would still help me greatly if you could do that. Thanks!
  • You hit the nail on the head - suhosin was the culprit. They (a small orange) changed some security settings and everything's smooth sailing now. Thanks for all the help. I'll post a ticket on trac when I get a chance.
  • It's ticket #72 - hopefully I filed the ticket correctly.
  • trisweb Administrator
    Looks great! Thanks for your help.
Sign In or Register to comment.