getManyManyComponents, pagination support?

37 views
Skip to first unread message

cms warrior

unread,
Apr 9, 2008, 3:07:01 AM4/9/08
to silverst...@googlegroups.com
Hey guys,

I was wondering if "getManyManyComponents()" supports pagination. I have tried everything i know to get it to work, but to no avail. I am using a ManyManyComplexTableField, so this is the easiest way to retrieve my data. This is the snippet am using

$doSet = $this->getManyManyComponents("Products","","","","{$SQL_start},10");

I have smthg like this in the template:

http://pastebin.com/m7acacea5

If i remove the limit, the pagination links appear, but all the products also appear. So that is kinda pointless.

I searched all over, forum, Doc and IRC, but couldn't find any answer.

Another question:

Assume the original query results from below is x

$doSet = $this->getManyManyComponents("Products","","","","{$SQL_start},10");

$doSet2 = $this->getManyManyComponents("Products");


$doSet->Count() and $doSet2->Count() will both return 10, instead of 10 and x.

Any suggestions as to how to work around this.

Thanks a lot for your time.

Ingo Schommer

unread,
Apr 9, 2008, 3:18:20 AM4/9/08
to silverst...@googlegroups.com
hm, which version of silverstripe are you using?

we fixed a caching issue with getManyManyComponents back in october 2007:

-------
Ingo Schommer | Senior Developer
SilverStripe

Skype: chillu23

Level 3, 97-99 Courtenay Place
Wellington, New Zealand

cms warrior

unread,
Apr 10, 2008, 1:21:54 AM4/10/08
to silverst...@googlegroups.com
Thanks Ingo,for pointing me in the right direction. Actually, the caching issue with getManyManyComponents wasn't fixed, it was only fixed for getComponents. I came across a fix for both problems i mentioned, i would like to add a patch that fixes those two issues to the DataObject class. Please advise on the best way to go about this.

Thanks again.

Ingo Schommer

unread,
Apr 10, 2008, 1:54:27 AM4/10/08
to silverst...@googlegroups.com
cool, glad it helped - have a look at http://open.silverstripe.com/#Submittingpatches for patch submission guidelines.

Sam Minnee

unread,
Apr 10, 2008, 1:57:50 AM4/10/08
to SilverStripe Development
Create a .diff file and post this to open.silverstripe.com, with
ticket type "patch".
We'll review it and, if it all looks good, merge it into trunk. It
would be released with the release produced after that.

Note that it won't be part of 2.2.2.

cms warrior

unread,
Apr 11, 2008, 12:16:15 AM4/11/08
to silverst...@googlegroups.com
Thanks guys!
Reply all
Reply to author
Forward
0 new messages