Problem/Motivation

admin/content/filesis currently a view, but it is no VBO view, so for example mass-deletion is not available.

Proposed resolution

Add a bulk form to that view, similar to admin/content

Remaining tasks

User interface changes

API changes

Issue fork drupal-2413781

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dawehner’s picture

Issue tags: +Novice

.

jibran’s picture

StatusFileSize
new58.63 KB
new2.49 KB

I don't think this is a novice task because we don't have any actions for files in core.
See

Anyways here is the start.

dawehner’s picture

Ah interesting ... I think someone has to work on generic entity plugings to delete an entity for example

jibran’s picture

Status: Active » Needs review
Issue tags: -Novice +Needs manual testing
StatusFileSize
new11.03 KB

Here we go.

+  /**
+   * {@inheritdoc}
+   */
+  public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
+    /** @var \Drupal\file\FileInterface $object */
+    return $object->access('delete', $account, $return_as_object);
+  }

Known problem always access denied.

Status: Needs review » Needs work

The last submitted patch, 4: 2413781-4.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review
StatusFileSize
new503 bytes
new11.52 KB

schema fixes.

Status: Needs review » Needs work

The last submitted patch, 6: 2413781-6.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review
StatusFileSize
new487 bytes
new12 KB

More schema fixes.

Status: Needs review » Needs work

The last submitted patch, 8: 2413781-8.patch, failed testing.

jibran’s picture

StatusFileSize
new581 bytes
new11.89 KB

Even more schema fixes.

jibran’s picture

Status: Needs work » Needs review

:/

jibran’s picture

Issue tags: +Needs screenshots, +Needs followup
StatusFileSize
new1.16 KB
new13.05 KB

Added some asserts. It should fail now.

+  /**
+   * {@inheritdoc}
+   */
+  public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
+    /** @var \Drupal\file\FileInterface $object */
+    return $object->access('delete', $account, $return_as_object);
+  }

Known problem always access denied.

We need a follow up for that to add the delete permission.

Status: Needs review » Needs work

The last submitted patch, 12: 2413781-12.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review
StatusFileSize
new1001 bytes
new13.05 KB

oh

Status: Needs review » Needs work

The last submitted patch, 14: 2413781-14.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review
StatusFileSize
new712 bytes
new13.06 KB

huh! another one.

Status: Needs review » Needs work

The last submitted patch, 16: 2413781-16.patch, failed testing.

nchase’s picture

its not only that there is no VBO. It also not possible to edit files at all. There is no "edit link" that lets me change the file...

Status: Needs work » Needs review

andriyun queued 16: 2413781-16.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 16: 2413781-16.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

grimreaper’s picture

StatusFileSize
new14.29 KB

Hello,

Thanks for the patch. Here is a rebased version.

I didn't have time to change the OO code, I think the following files will fail because of changes in core (PhpStorm does not detect classes):
- core/modules/file/src/Tests/FileListingTest.php
- core/modules/file/src/Plugin/Action/DeleteFile.php
- core/modules/file/src/Form/FileDeleteMultiple.php

Also here is my review, I made modifications in the uploaded patch.

  1. +++ b/core/modules/file/config/schema/file.views.schema.yml
    @@ -44,3 +44,7 @@ views.field.file_uri:
    +views.field.node_bulk_form:
    ...
    +  label: 'Node bulk form'
    

    Changing node to file.

  2. +++ b/core/modules/file/src/FileViewsData.php
    @@ -66,6 +66,14 @@ public function getViewsData() {
    +        'id' => 'bulk_form',
    

    Should be file_bulk_form to be consistent with the node and the user version.

I need the VBO feature for #2839304: Create actions to deploy individual entities, already created a patch for the taxonomy terms #2839351: VBO for taxonomy term.

I will be back in a week.

grimreaper’s picture

Hello,

I have tested the patch from comment 23, and the base to provide VBO for files works. I tested with an action from my module.

Now I will see to fix the default "delete" action provided by the patch.

EDIT: Sorry, I have tested with patch from comment 16, not comment 23.

grimreaper’s picture

Status: Needs work » Needs review
Issue tags: -Needs screenshots
StatusFileSize
new14.86 KB
new11.67 KB
new41.4 KB
new17.18 KB

Here is a patch (and an interdiff from comment 23) that fix the OO code.

I add two screenshots.

The permission "administer files" does not exist anymore so I put "access files overview" for the delete confirm form. I don't know if there is a better permission.

Status: Needs review » Needs work

The last submitted patch, 25: drupal-vbo_files-2413781-25.patch, failed testing.

grimreaper’s picture

Status: Needs work » Needs review
StatusFileSize
new1.46 KB
new15.06 KB

Fixing automated tests.

Text on the submit button and URL had changed.

Status: Needs review » Needs work

The last submitted patch, 27: drupal-vbo_files-2413781-27.patch, failed testing.

grimreaper’s picture

Status: Needs work » Needs review
StatusFileSize
new15.09 KB
new699 bytes

Fixing automated tests.

The site on the CI is in a subdirectory.

Status: Needs review » Needs work

The last submitted patch, 29: drupal-vbo_files-2413781-29.patch, failed testing.

grimreaper’s picture

Issue tags: -Needs manual testing

Hum, anyone having a tip to avoid this URL check problem with site in a subdirectory?

And also I do not understand the error in the Kernel test on the default config.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

grimreaper’s picture

Status: Needs work » Needs review
StatusFileSize
new12.96 KB

Hello,

After seeing an article on VBO and actions (https://www.flocondetoile.fr/blog/create-action-custom-mass-updates-drup...), I realized there is no need to add a view field (and so to modify file.views.schema.yml and FileViewsData.php) as it generated automatically if there is at least an action for the entity type.

So here is an updated patch against the 8.3.x branch.

It would be cool to have for all content entites at least a default "delete" action.

Status: Needs review » Needs work

The last submitted patch, 33: drupal-vbo_files-2413781-33.patch, failed testing.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mpp’s picture

Version: 8.6.x-dev » 8.8.x-dev
Status: Needs work » Needs review
StatusFileSize
new12.05 KB

Added reroll.

zero2one’s picture

Patch #38 works on 8.6.15.

Status: Needs review » Needs work

The last submitted patch, 38: 2413781_38.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

fernly’s picture

StatusFileSize
new12.04 KB

Reroll voor 9.1.x.
Replaced non-existing user.private_tempstore by tempstore.private service.

fernly’s picture

StatusFileSize
new12.1 KB

Patch 44 was missing pieces of refactoring.
Reroll voor 9.1.x.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

fernly’s picture

Version: 11.x-dev » 10.1.x-dev
Status: Needs work » Needs review
StatusFileSize
new12.43 KB

Patch rerolled against 10.1.x.

smustgrave’s picture

Version: 10.1.x-dev » 11.x-dev
Status: Needs review » Needs work
Issue tags: +Needs issue summary update, +Needs screenshots

11.x is the current development branch so code has to be merged there first and backported in applicable.

Adding new form to the UI should include screenshots in the issue summary.

Also encourage using MRs as patches are being phased out.

Gauravvvv made their first commit to this issue’s fork.

gauravvvv’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work

Per 52

ameymudras made their first commit to this issue’s fork.

fernly’s picture

StatusFileSize
new16.13 KB

Patch for people needing a stable patch in their project, based on the latest merge request.

nicxvan’s picture

There is an MR, hiding patch files.

kim.pepper made their first commit to this issue’s fork.

kim.pepper’s picture

Status: Needs work » Needs review

Rebased on 11.x

kim.pepper’s picture

Status: Needs review » Needs work

Looks like some legit test fails.

mohit_aghera made their first commit to this issue’s fork.

fernly’s picture

StatusFileSize
new18.5 KB

Rolled out patch against drupal 11.1.7, based on the latest MR state.

fernly’s picture

StatusFileSize
new29.78 KB

Stable patch based on current MR state. Works for Drupal 11.2.x.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

fernly’s picture

StatusFileSize
new17.96 KB

Stable patch against D11.3.3, based on the last patch.