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

ManyManyDataObjectManager not grabbing the Title correctly

Go to End

10 Posts   1681 Views


29 June 2009 at 10:23am Community Member, 288 Posts


I just set up a ManyManyDataObjectManager instead of the complextablefield and I am having the strangest issue ever.
The object in question inherits Sitetree directly so the fields I've got access to are the ones in the Sitetree table.

Now if I set the field to anything but Title, it displays the value from that field but if I set the value to Title it displays the id with a # in front.

Right now it looks like this and it works the way you'd expect. However if I switch out URLSegment for Title it all goes bonkers. If I grab the tables ID or anything else that works fine as well.

$modulesTablefield = new ManyManyDataObjectManager(
       'URLSegment' => 'Title', 'Created' => 'Created'
), 'getCMSFields_forPopup');
$modulesTablefield->setAddTitle( 'A Product' );

$fields->addFieldToTab( 'Root.Content.Products', $modulesTablefield );

return $fields;

If I run this as a regular ManyManyComplexTableField I get the title the way I should so I'm thinking it's something the class does.

Any ideas?

Kindly, Marcus.


29 June 2009 at 11:45am 4085 Posts

That's a really old bug. When did you last update your code?


29 June 2009 at 7:25pm Community Member, 288 Posts

Umm I downloaded the latest code yesterday and ran it on my computer.
I will try again now with the latest code but as far as I know, I was running the latest stable release.

Since I'm new to Silverstripe the oldest code I could be running would be about a week old.

I'll report back with my results.


3 July 2009 at 7:47am Community Member, 14 Posts

I've the same problem, using both the latest built available here and a fresh svn co. (rev 202). Any chance to fix this?


3 July 2009 at 8:17am 4085 Posts

Wow.. Thank God for SVN. I was able to track down the change I made several months ago and see that, while it had been applied to MMDOM, i had pasted it in above the old code rather than replacing it, so it was running correctly, then undoing itself.

Give it an update and see what happens.


3 July 2009 at 8:29am Community Member, 14 Posts

Thanks for the quick reply!

Unfortunately, this is what happens at rv 203:

[Notice] Undefined variable: items
GET /admin/?flush=1

Line 105 in /Users/Hubertus/Sites/30tage/dataobject_manager/code/HasManyDataObjectManager.php

Again, thanks for your help!


3 July 2009 at 8:43am 4085 Posts

Hmm.. I don't have a testing environment set up for MMDOM.. so I'll have to use you. Try now?


3 July 2009 at 8:49am Community Member, 14 Posts

Admin page loads with DOM, but we're back to original problem: title not picked up, instead table shows "#ID" with ID being the number. My custom getter doesn't work either...

Go to Top