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.
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
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?
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) ?
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)!
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?
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
Thanks! I've been meaning to update that for a while. Just checked it in.
I'm unsure how to address the problem I have, and it's probably my own fault for not understanding how this all fully works but...
I installed the dataobject_manager, swfupload and image_gallery correctly.
But When I come to this page...(See buttonproblem.jpg attachment) the button is all messed up, but none the less the button works, just not sure why it's like that.
Anyways my main problem is that I create an image gallery page using the image gallery template and then save & publish it, added the images fine, edit the albulm fine.
Then I go to look at it http://127.0.0.1/gallery/ and nothing but a blank template is there...why is this?
I created my own custom theme I don't know if this has anything to do with the problem.
I tried inserting <% include GalleryPageContent %> but that gave me huge missing file errors or something.
This is the error message...
[Warning] file_get_contents() [function.file-get-contents]: Filename cannot be empty
GET /gallery/album/Default-Album
Line 280 in D:\Web\xampp\htdocs\sapphire\core\SSViewer.php