You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently registering forms from FormFactory classes as form schemas requires applying an extension to ModalController - this should be doable via YAML config directly instead.
ModalController has an API to register form factories via YAML
There is a single action for getting a modal form - it accepts a unique identifier for the form as a route parameter, and returns the form (or returns an HTTP error response if no form is available for that identifier)
getvars are passed into form factories as needed (this will require either modifying existing factories, modifying the getForm() method signature, or modifying the names of the getvars currently used) Not relevant
All existing form factories that are routed through ModalController are registered using the new YAML config instead of as extensions or hardcoded actions
Note there's currently no documentation about setting up modal forms. There is some limited information about form schema but that's focused more on setting up the REST(ish) endpoints.
Because of that I've opted not to include documentation for this, as it would effectively require adding docs for the JS that results in building the modal on the front-end as well and I think that's a fair amount of work that doesn't feel super in-scope.
Any custom modal forms should continue working exactly as they were (extensions applied to ModalController still work), any customisations to the forms will continue working (the form factories aren't changed at all except for one change to the anchor factory, but that's just changing how it accepts the page ID and doesn't affect the actual form)... this doesn't break anything anyone is likely to be using in any way. I think the only docs we need are the auto-generated "this deprecated method was removed" in the changelog.
That said, if you want docs, let me know the scope of the docs you want and I'll see what I can do.
Note that I'm not able to easily make the actions provided by silverstripe/asset-admin/code/Extensions/RemoteFileModalExtension.php part of the generic API in ModalController - but they will keep working just fine as they are.
That has resulted in the scope of this work being limited to the link modal forms used in the WYSIWYG which is the main use of ModalController currently.
Currently registering forms from
FormFactory
classes as form schemas requires applying an extension toModalController
- this should be doable via YAML config directly instead.Related
Acceptance Criteria
ModalController
has an API to register form factories via YAMLgetvars are passed into form factories as needed (this will require either modifying existing factories, modifying theNot relevantgetForm()
method signature, or modifying the names of the getvars currently used)ModalController
are registered using the new YAML config instead of as extensions or hardcoded actionsPRs
CMS 5
Reassign to Guy after merging so they can merge up to 6 and rebase
CMS 6
Kitchen sink CI
Note there's currently no documentation about setting up modal forms. There is some limited information about form schema but that's focused more on setting up the REST(ish) endpoints.
Because of that I've opted not to include documentation for this, as it would effectively require adding docs for the JS that results in building the modal on the front-end as well and I think that's a fair amount of work that doesn't feel super in-scope.
Any custom modal forms should continue working exactly as they were (extensions applied to
ModalController
still work), any customisations to the forms will continue working (the form factories aren't changed at all except for one change to the anchor factory, but that's just changing how it accepts the page ID and doesn't affect the actual form)... this doesn't break anything anyone is likely to be using in any way. I think the only docs we need are the auto-generated "this deprecated method was removed" in the changelog.That said, if you want docs, let me know the scope of the docs you want and I'll see what I can do.
The text was updated successfully, but these errors were encountered: