Problem/Motivation
When displaying a View with a bulk update field an "empty" bulk form field is shown when there are no actions available (see image below). This can happen when access to available actions is restricted as proposed in #2172017: Bulk operations does not respect entity access between #19 and #89. It can also happen when a bulk update field is added to the View, but no actions are selected in the field's settings (though I would call this a misconfiguration).
How to reproduce
The easiest way to reproduce:
- Create a View with a bulk update field.
- On the bulk update field settings, for "Available actions" choose "Only selected actions" and for "Selected actions" uncheck all.
- Display the View.
Proposed resolution
The bulk form field should not be rendered when there are no actions available.
Remaining tasks
TBD.
User interface changes
The bulk form field will not be shown if there are no actions available.
API changes
None.
Comment | File | Size | Author |
---|---|---|---|
#20 | Screenshot 2023-08-05 at 20-14-04 Content dev2-web.png | 7.11 KB | quietone |
#10 | 2402155-10.patch | 1.4 KB | nikita_tt |
Comments
Comment #1
MegaChriz CreditAttribution: MegaChriz commentedComment #2
mgiffordOk, I think since that issue is fixed we can work on this one.
Comment #3
MegaChriz CreditAttribution: MegaChriz commentedNote that until #91 #2172017: Bulk operations does not respect entity access was about two issues in one:
Issue 2 was what the issue was originally about and also what was fixed. When proposal fixes for issue 1 where posted in that issue, the problem reported in this issue (empty bulk form field) came to light. I'm not sure if there is a follow-up issue created for issue 1 (restrict access to available operations). If there is none and if that issue somehow became obsolete, then this issue can only be reproduced by creating a bulk update field with no actions selected (see issue summary). In that case I would judge this issue as a misconfiguration.
Comment #10
nikita_ttI guess "#emtpy_option" handles the issue.
Comment #11
nikita_ttComment #18
borisson_The tests need to be updated for this, but there also should be specific testcoverage added for this new value as well.
1. action\Functional\BulkFormTest -> The assertion should be updated.
2. node\Functional\Views\BulkFormTest -> The assertions should be updated.
3. \views\Functional\Plugin\ViewsBulkTest -> I don't know why this test is failing, but it must be related because it's in views bulk as well.
4. media_library\FunctionalJavascript\MediaLibraryTest -> This looks like it was a random failure.
Comment #20
quietone CreditAttribution: quietone as a volunteer commentedI tested this on Drupal 11.x, standard install, using the steps in the IS. I generated content with devel_generate and made a new test view. Here is a screenshot of the the bulk action selection now.
Because of that I am closing this as outdated.