- Issue created by @dww
- First commit to issue fork.
- πΊπ¦Ukraine khiminrm
I've committed the simplest solution - when we create action for specific entity type, workflow and action.
I've not found default solution to add custom additional fields on the action selection form.Drupal\views\Plugin\views\field::BulkForm
builds only select list widget for the options.To add custom conditional fields, I think we have to alter the bulk form and add the fields dynamically when our plugin is selected. Still researching if we can implement this in other way.
- πΊπ¦Ukraine khiminrm
I've added batch processing of the selected entities as there can be event subscribers to the state transitions events, so maybe it can take some time.
I've added also the messages, but have changed some strings.
Also I've added message for the entities with the empty state field. Maybe we can unite it with the count of the not allowed transition message?Regarding more complex action form when we can select workflow and state transition, maybe it can be only possible by creating custom views form similar to BulkForm and only for the state transition action. And maybe then only one of them can be used at the same time.
Ideas?
- πΊπ¦Ukraine khiminrm
I've created bulk form by extending BulkForm from views and new non-configurable action plugin so it now possible to select workflow and transition on the views bulk action form.
Testing steps:
1. Enable Actions UI module.
2. Goto /admin/config/system/actions and add new action(s).
3. In the select list you should see ''Apply state transition to order', ''Apply selected state transition to order' if you have enabled commerce_order can see other options with name of an entity which has state fields.
''Apply state transition to ...' is not configurable action and will work only with new views bulk form plugin ''Bulk update (state_machine)''
'Apply selected state transition to ...' is configurable action, so you can pre-select workflow and transition to apply. This action can work with default 'Bulk update' views form.
4. Create or edit view and add 'Bulk update (state_machine)''. Save the view.
5. Open page with the view, select entities and select action. For the ''Apply state transition to ..." the 'Workflow' and 'Transition' select lists should appear. Try to apply the action.Example of the action form on views:
I will review and improve current fixes. I think we need to try alter default views bulk form and exclude actions created from the new non-configurable plugin from form's setting form.
- πΊπ¦Ukraine khiminrm
Committed improvements in code and updated README.md
- last update
8 months ago PHPLint Failed - Status changed to Needs review
8 months ago 1:06pm 21 March 2024 - πΊπ¦Ukraine khiminrm
I've created MR.
For testing on local there are two options:- Apply patch to the module by adding the patch from the MR's diff in composer.json.
- Clone the module from the issue fork. Fetch the fork's branch and checkout to it on local. See commands above in the head of the issue.