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.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

[Solved] ModelAdmin - Create and search buttons return 'Not Found'


Reply

2 Posts   888 Views

Avatar
Ben Gribaudo

13 February 2009 at 10:12am (Last edited: 17 February 2009 3:05am), Community Member, 181 Posts

Hello,

Started experimenting with ModelAdmin today--neat concept! Ran into difficulty with the create and search buttons that appear in the auto-created add/search/import panel. If I click on either of those buttons, a red "Not Found" error message is displayed at the bottom of the main CMS admin panel. Not good. If I add "Director::addRules(100, array('admin/quotes/$Class/$Action/$ID' => 'QuotesAdmin'));" to my module's _config.php and then click on create or search, the main panel shows the "welcome to SilverStripe now loading" screen.

Would you have any clues as to what I need to do to get create and search working?

I'm running the http://open.silverstripe.com/browser/modules/cms/branches/nestedurls code base on Apache 2.2 running on Win XP.

Thank you,
Ben

-----------

Code:

<?
class QuotesAdmin extends ModelAdmin {

protected static $managed_models = array(
'QuoteModel'
);

static $url_segment = 'quotes';
static $menu_title = 'Quotes';

}
?>

<?
class QuoteModel extends DataObject {
static $db = array(
'Quote' => 'Text',
'Source' => 'Varchar',
'Author' => 'Varchar'
);
static $searchable_fields = array(
'Quote',
'Source',
'Author'
);
}
?>

Avatar
Ben Gribaudo

17 February 2009 at 3:05am Community Member, 181 Posts

Actually, I was running http://svn.silverstripe.com/open/phpinstaller/branches/nestedurls/.

At any rate, the problem ended up being the fact that there were some changes to trunk that hadn't been ported over to nestedurls, for my problem went away when I switched to trunk.

Have a great day,
Ben