This is a VERY simple module that does only one thing:
Disables the option "Delete the account and its content." when cancelling a user account in the administration.

Project link: https://www.drupal.org/sandbox/alpe89/2852847

Git clone
git clone --branch 7.x-1.x https://git.drupal.org/sandbox/alpe89/2852847.git disable_delete_account_content

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alpe89 created an issue. See original summary.

jeetendrakumar’s picture

Status: Needs review » Needs work

@alpe89

Please update the git clone url for non-maintainer in issue summery page and fix errors reported by automated review tools.

https://pareview.sh/node/1102

alpe89’s picture

Issue summary: View changes
alpe89’s picture

@jeetendrakumar

Fixed:
- git clone url fixed
- indent changed to 2 spaces instead of tabs
- added file doc comment
- added function doc comment
- removed 'version' from .info file
- fixed "Line exceeds 80 characters; contains 89 characters" in README

alpe89’s picture

Status: Needs work » Needs review
alpe89’s picture

New automated review: https://pareview.sh/node/1102

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

sjpagan’s picture

Hi @alpe89,
Please fix this problem:
1) If set the option : Delete the account and its content. in Account Settings -> /admin/config/people/accounts , and try delete the account, the options disabled is preselected.
2) Specifies the utility of this module, a better solution would be to integrate a hook_permission () and not a form_alter()...

sjpagan’s picture

Status: Needs review » Needs work
alpe89’s picture

@sjpagan

I'm sorry I don't understand #1. Can you please explain it a bit more detailed?
And why is hook_permission better than form_alter in this scenario?

alpe89’s picture

Status: Needs work » Needs review

Setting the status to 'Needs review' because I'm not sure what @sjpagan meant.

sjpagan’s picture

Hi @alpe89,

Follow the instruction as root:

1) Go to Account settings -> /admin/config/people/accounts img admin_config_people_accounts.png
2) Set Delete the account and its content. and save
3) Create new user
4) Select new user and cancel it
5) Whit your module is enable, The option 'Delete the account and its content.' is selected img cancel_account.img

Are you sure that it is correct?

sjpagan’s picture

Status: Needs review » Needs work
alpe89’s picture

@sjpagan

ah I see. I'm not sure what I could do about that though.
Doesn't seem like a big problem to me, but if you have any ideas how to "fix" it, I'm open

sjpagan’s picture

Hi @alpe89,

one little solution is:

  unset($form['user_cancel_method']['user_cancel_delete']);
alpe89’s picture

Status: Needs work » Needs review

@sjpagan

Good point.
I changed the code, and edited the title and screenshot in the project

shamas41@gmail.com’s picture

@alpe89

Manual Review

Installed and tested your module.
So I can confirm it is working, after enabling your module this option is unset 'Delete the account and its content'

Suggestion:

But I think what you need to do is to have permissions in your module.
So say admin wants site managers to not to use this 'Delete the account and its content' option but wants to use this option himself. So he can just setup the permission and site managers will not see this option, but admin can still see/use this option

Automated Review

One minor issue in Automated Review

Coder Sniffer has found some issues with your code (please check the Drupal coding standards).

FILE: ...repos/pareviewsh/pareview_temp/disable_delete_account_content.module
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
5 | WARNING | Line exceeds 80 characters; contains 81 characters
--------------------------------------------------------------------------

Time: 167ms; Memory: 6Mb

But otherwise this module is working fine for me So. RTBC from my side

shamas41@gmail.com’s picture

Status: Needs review » Needs work
djalxs’s picture

This module does not have a sufficient amount of code for a proper review to gain full project promotion permissions.

I feel you could expand on this project somewhat to ensure there is enough code by writing a hook_help() and hook_permissions() implementation.

Looking at the code, the user settings page under admin > configuration will still allow the option to select deleting content automatically however I'm not in a position to test right now so all tips are from reading the code.

You may get this module approved as is but you will not get full access off this review so you would have to get another module reviewed for full access if this module isn't expanded somewhat.

alpe89’s picture

Status: Needs work » Needs review

Thanks for the feedback @shamas4 and @djalxs

Good points.
I have now updated the code to include a hook_permission() and hook_help()
so the user now needs a permission to have access to the option.

apaderno’s picture

Priority: Normal » Critical

To the reviewers: Please change back the priority to Normal after doing a review.

sleitner’s picture

Priority: Critical » Normal
Status: Needs review » Needs work

Automated Review

Review of the 7.x-1.x branch (commit be0c307):

  • Your README.txt does not follow best practices (headings need to be uppercase). See https://www.drupal.org/node/2181737 .
    • The INTRODUCTION section is missing.
    • The REQUIREMENTS section is missing.
    • The INSTALLATION section is missing.
    • The CONFIGURATION section is missing.
  • No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

This automated report was generated with PAReview.sh, your friendly project application review script.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
No: Does not follow the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
No: Does not follow the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

apaderno’s picture

Status: Needs work » Closed (won't fix)

If you are still working on this application, you should fix all known problems and set the status to Needs review. (See also the project application workflow.)
Please don't change status of this application if you aren't sure you have time to dedicate to this application, or it will be closed again as won't fix.

I am closing this application due to lack of activity.