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.

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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Image_gallery and nestedUrls (Silverstripe 2.4)


Go to End


11 Posts   3789 Views

Avatar
wmk

Community Member, 87 Posts

19 May 2010 at 2:15am

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

Community Member, 103 Posts

26 May 2010 at 8:56am

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

Avatar
UncleCheese

Forum Moderator, 4102 Posts

26 May 2010 at 9:21am

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

Community Member, 103 Posts

27 May 2010 at 1:16am

Worked like a charm. Thanks UncleCheese!

Avatar
Chucky2k

Community Member, 32 Posts

27 May 2010 at 3:34pm

Hi Uncle Cheese,

LinkingMode is not working when nestedUrls are enabled.

Cheers

David

Avatar
UncleCheese

Forum Moderator, 4102 Posts

28 May 2010 at 2:18am

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

Avatar
Chucky2k

Community Member, 32 Posts

28 May 2010 at 11:36am

Yeah, that was the one.

Thanks again UC

Avatar
monsieurk

Community Member, 4 Posts

1 June 2010 at 2:26am

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