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

404 On custom leftandmain extension


Go to End


2 Posts   1477 Views

Avatar
UndefinedOffset

Community Member, 30 Posts

10 November 2009 at 8:34am

I'm trying to use dataobjectmanager on a custom leftandmain extension so I can have like a global settings page. But when I try and add an item to the dataobjectmanager the dialog pops up and shows a file not found error. When I put some debug code in the method that generates the form for the popup that renders so I know its not a true 404 error. When I look at the url of the popup it shows http://localhost/silverstripe/admin/settings/regionManagment/field/Regions/add. Which looks correct to me other than that it has the /settings/ it's the same as the ones that I use on the content pages.

Anyone have any ideas or know of a fix for this problem?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

10 November 2009 at 9:00am

The proper format for the URL should be:

/admin/[ModelName]/[ParentObjectClass]/[ParentObjectID]/EditForm/field/[RelationName]/add

You're missing a few things there.

I usually just do Globals in ModelAdmin. You can enforce singularity with the canCreate() function and use javascript to just edit the only record. I also use static methods in the Globals class to get values, e.g. Globals::get('HomeImageID');