Jump to:

10993 Posts in 2727 Topics by 1818 members

All other Modules

SilverStripe Forums » All other Modules » ModelAdmin not working on 2.3.2

Discuss all other Modules here.

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

Page: 1 2
Go to End
Author Topic: 2728 Views
  • klikhier
    Avatar
    Community Member
    150 Posts

    ModelAdmin not working on 2.3.2 Link to this post

    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?

  • rpw2
    Avatar
    Community Member
    6 Posts

    Re: ModelAdmin not working on 2.3.2 Link to this post

    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.

  • klikhier
    Avatar
    Community Member
    150 Posts

    Re: ModelAdmin not working on 2.3.2 Link to this post

    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.

  • klikhier
    Avatar
    Community Member
    150 Posts

    Re: ModelAdmin not working on 2.3.2 Link to this post

    I removed 'protected' from

    static $managed_models = array(

    and it worked...

  • Sam
    Avatar
    Administrator
    679 Posts
  • gp
    Avatar
    Community Member
    5 Posts

    Re: ModelAdmin not working on 2.3.2 Link to this post

    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

  • Capt. Morgan
    Avatar
    Community Member
    30 Posts

    Re: ModelAdmin not working on 2.3.2 Link to this post

    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.

  • BLU42 Media
    Avatar
    Community Member
    71 Posts

    Re: ModelAdmin not working on 2.3.2 Link to this post

    Just bumping this thread up to generate some interest!

    Thanks!
    John

    2728 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.