Jump to:

10390 Posts in 2201 Topics by 1712 members

All other Modules

SilverStripe Forums » All other Modules » Image Gallery Extension: Testers Needed

Discuss all other Modules here.

Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w

Go to End
Author Topic: 67125 Views
  • WalterW
    Avatar
    Community Member
    17 Posts

    Re: Image Gallery Extension: Testers Needed Link to this post

    We use this extension and like it very much.
    But sometimes (maybe once a month) we got error emails by users, as:
    SELECT `ImageGalleryAlbum`.*, `ImageGalleryAlbum`.ID,

    if(`ImageGalleryAlbum`.ClassName,`ImageGalleryAlbum`.ClassName,'ImageGalleryAlbum') AS RecordClassName FROM `ImageGalleryAlbum` WHERE (ImageGalleryPageID = 45 AND SortOrder < ) ORDER BY SortOrder DESC LIMIT 1 You have an error in your SQL syntax

    you sere that the sortorder is not set in the statement "SortOrder < " !

    this emergs from

    # DataObject::get_one(ImageGalleryAlbum,ImageGalleryPageID = 45 AND SortOrder < ,,SortOrder DESC)
    Line 337 of ImageGalleryPage.php
    # ImageGalleryPage_Controller->adjacentAlbum(prev)
    Line 347 of ImageGalleryPage.php

    someone has an idea?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Image Gallery Extension: Testers Needed Link to this post

    Weird. I don't know why your SortOrder field would be null. I would just sort your albums once and that will update all of them with proper values.

  • WalterW
    Avatar
    Community Member
    17 Posts

    Re: Image Gallery Extension: Testers Needed Link to this post

    The database field "SortOrder" is set for all pages (values from "0" to "4")!

    It seems, that the property {$this->CurrentAlbum()->SortOrder} (in the ImageGalleryPage.php) is not set under some (rare) circumstances.

    Maybe we could do a reasonable preset for this property?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Image Gallery Extension: Testers Needed Link to this post

    It should be setting the sort automatically on create. If you look at the last function in SortabledDataObject, you see..

       public function onBeforeWrite()
       {
          if(!$this->owner->ID) {
             if($peers = DataObject::get($this->owner->class))
                $this->owner->SortOrder = $peers->Count()+1;
          }
       }   

    Maybe something is wrong with that logic, but I've never seen this happen before.

    Maybe instead of !$this->owner->ID it should be if(!$this->owner->SortOrder) ?

  • WalterW
    Avatar
    Community Member
    17 Posts

    Re: Image Gallery Extension: Testers Needed Link to this post

    To help you: This problem happens, when customers look to our images, they cannot insert or edit anything in the CMS!
    So the image related tables are quite static (maybe they have not been changed for some weeks)!

  • Pranil
    Avatar
    Community Member
    17 Posts

    Re: Image Gallery Extension: Testers Needed Link to this post

    Hey i get the same problem every now and then. Any ideas on how to fix it? Do we try the fix that UncleCheese suggested? Or is it something else?

  • denisrosset
    Avatar
    Community Member
    4 Posts

    Re: Image Gallery Extension: Testers Needed Link to this post

    Hi all,

    I tried to change the ImageGallery css in my custom theme, and was unable to do so using the stock ImageGallery install. If you want to do the same, you need to change a line in ImageGalleryPage.php; see attached patch.

    Cheers,

    Denis

    Attached Files
  • UncleCheese
    Avatar
    4085 Posts

    Re: Image Gallery Extension: Testers Needed Link to this post

    Thanks! I've been meaning to update that for a while. Just checked it in.

    67125 Views
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.