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.

All other Modules /

Discuss all other Modules here.

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

ModelAdmin not working on 2.3.2


Go to End


10 Posts   4766 Views

Avatar
klikhier

Community Member, 150 Posts

24 June 2009 at 10:42pm

I couldn't get the ModelAdmin example from the documentation http://doc.silverstripe.com/doku.php?id=modeladmin to work with SilverStripe 2.3.2. On 2.3.1 it worked out of the box.

Anyone else with this issue and/or solution?

Avatar
rpw2

Community Member, 6 Posts

25 June 2009 at 9:55am

Hi, Have you checked out the Presentation, link at bottom of page you mentioned. You can download the code and that worked for me on 2.3.2.

I have other issues tho; validation? I have added the method to tell it what fields are required (getCMSValidator()) but when you are on the create/add form and submit with missing data, presumably the redirect is based on url but as the url in browser is admin/mycms it goes back to a blank on the rightside. If you click on create again the form (rightside) is displayed again, this time with the validation errors, good but not what I expected. How to stay on same form? I think the member one uses js for validation? Is this easy to implement for custom ones too? But I would have thought the framework validator to work as it does for other forms.

Also are some *.ss changes needed to display form fields correctly (rightside). eg. new CountryDropdownField('Country', ..) displays on frontend or other forms as expected but not in my create/add form generated by modeladmin.

Thanks.

Avatar
klikhier

Community Member, 150 Posts

25 June 2009 at 7:10pm

Strange, I really can't get it to work with 2.3.2. I have copied 2.3.2 files into root. Added the code/ folder from the presentation and run dev/build... I still get a blank page :(

When replacing folders cms/, sapphire/, and jsparty/ with those from 2.3.1 release I can run dev/build without a problem.

Avatar
klikhier

Community Member, 150 Posts

25 June 2009 at 9:24pm

I removed 'protected' from

static $managed_models = array(
and it worked...

Avatar
gp

Community Member, 5 Posts

7 July 2009 at 10:43pm

Hi,

I have the same problem to get validation to work with the ModelAdmin as rpw2 already described. Is there any solution? ModelAdmin already uses the getCMSValidator() function but it is not working correctly. I wanted to check if this problem is already solved in the current trunk. But when I use the trunk version of "cms" ModelAdmin is showing no UI anymore.

Is there any workaround to get validation to work with ModelAdmin in 2.3.2?

Thanks,
Gerrit

Avatar
Capt. Morgan

Community Member, 30 Posts

7 August 2009 at 1:43am

I am also having the same problem as rpw2 and gp with the validation messages. Would be very grateful if anyone who solved it could share.

Avatar
BLU42 Media

Community Member, 71 Posts

25 October 2009 at 10:56am

Just bumping this thread up to generate some interest!

Thanks!
John

Go to Top