Document the need for quick action schema.yml file.

This commit is contained in:
Michael Stenta 2023-10-23 16:12:34 -04:00
parent 8266123b9a
commit 10203fffad
1 changed files with 12 additions and 1 deletions

View File

@ -456,10 +456,12 @@ selected entities can then be used in the quick form code in various ways.
### Providing a quick form action
To add a quick form action, two additional files are added to the module:
To add a quick form action, three additional files are added to the module:
1. a PHP class in `src/Plugin/Action` that extends from `QuickFormActionBase`
2. an action config entity in `config/install/system.action.*.yml`
3. a `config/schema/[mymodule].schema.yml` file that describes action schema
(see example below).
For example, an action that redirects to the "Harvest" quick form defined above
for prepopulating the "Asset" field would be provided as follows:
@ -511,6 +513,15 @@ plugin: harvest
configuration: { }
```
`/config/schema/farm_quick_harvest.schema.yml`:
```yml
# Schema for actions.
action.configuration.harvest:
type: action_configuration_default
label: 'Configuration for the harvest action'
```
Note that config entities are only created when the module is installed. In
order to add a config entity to a module that is already installed, an update
hook must be used to manually create the config entity.