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.

Archive /

Our old forums are still available as a read-only archive.

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

HasManyComplexTableField - sub-URL


Go to End


2 Posts   1503 Views

Avatar
haswalt

Community Member, 16 Posts

16 October 2008 at 3:21am

Hi all,

I have a small problem. I have created a custom module, and in that i have defined a one-many relationship.

Now on the CMS page for the module i have added a HasManyComplextableField. This has worked fine.

But when i click the add button the popup loads with the following message displayed:

"I can't handle sub-URLs of a TemplatesAdmin object."

TemplatesAdmin being the module class name!

Anyone have any ideas why this is?

My code is here:

new LabelField('Bespoke data fields for this template:'),
					$phTable = new HasManyComplexTableField(
						new self::$tree_class,
						'placeholder',
						'PlaceHolder',
						array(
							'ID',
							'Title' => 'Placeholder Name',
							'DataType' => 'Data Type',
							'InputMethod' => 'Data Input Method'
						)
					)

Avatar
haswalt

Community Member, 16 Posts

16 October 2008 at 3:53am

Fixed it!!

For anyone else that hits this when creating custom code for CMS modules. Make sure the currentPageID is set correctly otherwise it will fail to populate the relationship and so you get this nice ambiguous error!

Harry