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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

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

Usage of ComplexTable when subclassing LeftAndMain?


Go to End


3 Posts   1499 Views

Avatar
aimcom

Community Member, 8 Posts

23 September 2010 at 11:18pm

Edited: 23/09/2010 11:58pm

At the moment, I'm trying to program a new backend module. For this purpose, I subclassed LeftAndMain and created several different DataObjects. This all works quite well, except for one issue: I can use simple fields like TextField oder EmailField without any problems, but a ComplexTableField doesn't work. The table field itself is displayed correctly, but when trying to add a new object, a popup is opened and this error message is shown:
[User Error] Uncaught SS_HTTPResponse_Exception: I can't handle sub-URLs of a Form object. GET /admin/my_module/EditForm/field/Paragraphs/add
Line 305 in /srv/www/htdocs/xyz/silverstripe-v2.4.0/sapphire/core/control/RequestHandler.php

I tried to overwrite EditForm() and getEditForm(), but haven't found a solution so far. It would be nice if somebody could give me a hint.

Avatar
Apophenian

Community Member, 46 Posts

3 April 2011 at 11:33am

Did you have any luck with this? I am having a similar problem.

Avatar
Apophenian

Community Member, 46 Posts

3 April 2011 at 11:54am

Actually, I managed to resolve this after all - it's a bit of a hack, but it works.

I subclassed TableListField (ComplexTableField in your case), and in my subclass, I created a method Link() that pointed to the url of my custom admin area eg

function Link(){
 return Director::absoluteBaseURL() . 'admin/<url of my custom admin>/';
}

Hopefully this works for you.