Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Image_gallery and nestedUrls (Silverstripe 2.4)


Go to End
Reply

11 Posts   2063 Views

Avatar
wmk

19 May 2010 at 2:15am Community Member, 45 Posts

Hi Uncle Cheese,

i discoverd a bug in image-gallery module.

Albums work fine when the gallery is a root page (like in 2.3), e.g. domain.com/gallery/album/myalbum but doesn't when it's a subpage, e.g domain.com/stuff/gallery/album/myalbum

The error:

[Notice] Trying to get property of non-object
GET /home/galerie/album/testalbum

Line 194 in /path/to/public_html/image_gallery/code/ImageGalleryPage.php

Seems like$this->CurrentAlbum() is empty, cause gallery doesn't get the right param back using Director::urlParam('ID') in CurrentAlbum()...

any hints?

cheers,

wmk

Avatar
theoldlr

26 May 2010 at 8:56am Community Member, 103 Posts

Any luck with solving this problem? I am facing the same issue.

Avatar
UncleCheese

26 May 2010 at 9:21am 4085 Posts

Finally had a chance to test this. It's actually a bug with SS 2.4.. They never updated Director::urlParams() to evaluate nested urls, so it returns the wrong values, as you saw.

Found a workaround by using Controller::curr()->urlParams. The changeset is checked in.

Avatar
theoldlr

27 May 2010 at 1:16am Community Member, 103 Posts

Worked like a charm. Thanks UncleCheese!

Avatar
Chucky2k

27 May 2010 at 3:34pm Community Member, 32 Posts

Hi Uncle Cheese,

LinkingMode is not working when nestedUrls are enabled.

Cheers

David

Avatar
UncleCheese

28 May 2010 at 2:18am 4085 Posts

Thanks.. you mean in ImageGalleryAlbum? That should be all set now.

Avatar
Chucky2k

28 May 2010 at 11:36am Community Member, 32 Posts

Yeah, that was the one.

Thanks again UC

Avatar
monsieurk

1 June 2010 at 2:26am Community Member, 4 Posts

Hi,

I was about to create a thread about this bug when I found this one.

I had faced the same problem than wmk (an ImageGalleryPage not working when it is level 2 or more, but works fine when root).
I have found a parade (using VirtualPage) but still want to have an well-formed structure for my ImageGallery.

Got the last trunk build.
Just test it a minute ago.
Works like a charm.

Thanks UncleCheese for this upgrade and your work.

Go to Top