Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fane.gallant created an issue. See original summary.

dipakmdhrm’s picture

Priority: Normal » Major

Bumping this up to Major as this really is a major feature missing from the module.

dipakmdhrm’s picture

Priority: Major » Critical

This is actually critical as this is blocking the stable release.

abhisekmazumdar’s picture

Assigned: Unassigned » abhisekmazumdar
abhisekmazumdar’s picture

Status: Active » Needs review
FileSize
7.35 KB

This patch will add the following changes:

  • Add two routing and menu links
    • admin/people/delete_people
    • admin/content/delete_content
  • One Service -Which list out the available content type

What's Not working yet:

  • Option to reset the node count.
  • Quick delete option.
  • Taxonomy route batch delete option yet to be added.

Note: Apply the patch on the simplytest sandbox environment gives an error.

abhisekmazumdar’s picture

Things changed in this patch:

  1. menu link in one place user Development.
  2. Checkbox to delete all content.
  3. Unwanted services removed for the routing.
  4. Add option to delete users by role
sumitmadan’s picture

Status: Needs review » Needs work
  1. +++ b/src/Form/ContentDelete.php
    @@ -0,0 +1,115 @@
    +    $delete_all_checkbox = $form['select-all']['#value'];
    

    Use $form_state to fetch the selected values.

  2. +++ b/src/Form/ContentDelete.php
    @@ -0,0 +1,115 @@
    +      dsm("No Node Found");
    

    "dsm" depends on devel module.

  3. +++ b/src/Form/PeopleDelete.php
    @@ -0,0 +1,111 @@
    +    $form['select-all'] = [
    

    Use "_" hyphen instead of "-" underscore for name of form elements. Drupal will convert the hyphen to underscore while generating html.

  4. +++ b/src/Form/PeopleDelete.php
    @@ -0,0 +1,111 @@
    +    unset($userTypeList['anonymous']);
    

    Instead of setting and unsetting, use a condition inside foreach.

abhisekmazumdar’s picture

Status: Needs work » Needs review
FileSize
8.75 KB
4.91 KB

Thanks, @sumitmadan.
The suggested changes are done in this new patch.

dipakmdhrm’s picture

Status: Needs review » Needs work

Thanks for working on this @abhisekmazumdar.
This was long overdue and much needed patch. Really appreciate your work on this and this would really help us to finally make a stable release for this module.
Also, really good work on patch:

  1. +++ b/src/Controller/ContentDeleteController.php
    @@ -53,10 +53,10 @@ class ContentDeleteController extends DeleteControllerBase {
    +      'title' => $this->t('Deleting Node'),
    +      'init_message' => $this->t('Node deletion is starting.'),
    +      'progress_message' => $this->t('Deleting Node...'),
    +      'error_message' => $this->t('Node deletion has encountered an error.'),
    

    Nice catch!
    Thanks for this.

Suggestions for few changes:

  1. diff --git a/.DS_Store b/.DS_Store
    

    I think this was added by mistake.
    .DS_Store is MacOS-specific folder-settings file and is not needed here.

  2. +++ b/delete_all.routing.yml
    @@ -0,0 +1,15 @@
    +    _permission: 'administer site configuration'
    

    Let's make this 'administer content'

  3. +++ b/delete_all.routing.yml
    @@ -0,0 +1,15 @@
    +    _permission: 'administer site configuration'
    

    And this as 'administer users'

  4. +++ b/src/Form/ContentDelete.php
    @@ -0,0 +1,115 @@
    +    $form['type_details']['selete_node_type'] = [
    ...
    +    $selected_node_type = $form_state->getValue('selete_node_type');
    

    Typo: selete_node_type.
    We can simply call it node_type

  5. +++ b/src/Form/PeopleDelete.php
    @@ -0,0 +1,108 @@
    +    $form['role_details']['selete_role_type'] = [
    ...
    +    $selected_role = $form_state->getValue('selete_role_type');
    

    Typo here as well

abhisekmazumdar’s picture

Status: Needs work » Needs review
FileSize
8.58 KB
2.88 KB

Thank You @dipakmdhrm for your suggestion and appreciation.

dipakmdhrm’s picture

Status: Needs review » Needs work
+++ b/delete_all.routing.yml
@@ -0,0 +1,15 @@
+    _permission: 'administer content'

Yikes!!!!
Just realizing that 'administer content' is actually not a valid permission. It's 'administer nodes'.
Totally my fault. Apologies for misleading you in my last comment.

Can you please fix the patch?
Apologies again.

abhisekmazumdar’s picture

Status: Needs work » Needs review
FileSize
8.58 KB
439 bytes

I too missed crossing check it. It's my fault too. I have updated the new patch with the required changes.
Thank You.

dipakmdhrm’s picture

Status: Needs review » Reviewed & tested by the community

dipakmdhrm’s picture

Status: Reviewed & tested by the community » Fixed

Thank you @abhisekmazumdar for your work on this.
Really good job and this would help us to finally make a stable release for this module.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

abhisekmazumdar’s picture

Assigned: abhisekmazumdar » Unassigned