sheadawson / silverstripe-shortcodable

Provides a GUI for CMS users to insert Shortcodes into the HTMLEditorField + an API for developers to define Shortcodable DataObjects and Views.
MIT License
48 stars 36 forks source link

WIP: Form Controller Fix #7

Closed jedateach closed 8 years ago

jedateach commented 9 years ago

@sheadawson I wouldn't merge this yet, I'm just creating this pull request to start the conversation about changes I'm making.

I've restructured the controller a bit into separated functions. I've added an 'edit' route so that includes the shortcode type. This allows us to use form fields that require ajax, such as UploadField, etc.

Its probably easiest to glance over this file: https://github.com/jedateach/silverstripe-shortcodable/blob/formcontrollerfix/code/controllers/ShortcodableController.php

Theres a few issues I hope to resolve:

I'm not sure if I've broken the data object stuff, as so far I've just worked with a ViewableData class.

OverviewLink (Shortcodable) object: https://gist.github.com/jedateach/a13928f1032fe0df8825

sheadawson commented 8 years ago

@jedateach thanks for doing the ground work. I've pulled in a lot of this code here https://github.com/sheadawson/silverstripe-shortcodable/commit/40929c75e2a54fa3da9067e68b1a290b1ebad525

This fixes #12. Only issue left is UploadFields and any other fields that have array values like CheckboxSetField

sheadawson commented 8 years ago

Upload fields and others with array values now working https://github.com/sheadawson/silverstripe-shortcodable/commit/22e68fc47913811b36980f04acae39dc0db7ee2c