10390 Posts in 2201 Topics by 1712 members
| Go to End | Next > | |
| Author | Topic: | 67125 Views |
-
Re: Image Gallery Extension: Testers Needed

12 October 2009 at 5:52am Last edited: 12 October 2009 5:53am
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.phpsomeone has an idea?
-
Re: Image Gallery Extension: Testers Needed

12 October 2009 at 11:03am
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.
-
Re: Image Gallery Extension: Testers Needed

12 October 2009 at 11:57pm
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?
-
Re: Image Gallery Extension: Testers Needed

13 October 2009 at 1:14am
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) ?
-
Re: Image Gallery Extension: Testers Needed

13 October 2009 at 1:47am
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)! -
Re: Image Gallery Extension: Testers Needed

13 October 2009 at 5:01pm Last edited: 13 October 2009 5:01pm
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?
-
Re: Image Gallery Extension: Testers Needed

25 January 2010 at 6:28am Last edited: 25 January 2010 6:43am
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
-
Re: Image Gallery Extension: Testers Needed

25 January 2010 at 7:17am
Thanks! I've been meaning to update that for a while. Just checked it in.
| 67125 Views | ||
| Go to Top | Next > |



