Hi
The basis use of this module is when you cancel a user the content belongs to this user can be assigned to other users from different roles.

Installation
Like other drupal module download the codebase from git url and put it inside your project, sites/all/modules directory and enble the module.

Configuration
1. Enable the module.
2. You will have one more option(5th) with the list of cancel options.
3. Option text will be "Disable the account and transfer its content to another user.".
4. If you want to assign the content to specific user, choose the role first,
then select another user and cancel the account of selected user.

Link Of Project : https://www.drupal.org/sandbox/shipra.wasson/2435969
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/shipra.wasson/2435969.git usercancel_contentassigntootheruser

Pareview:
http://pareview.sh/pareview/httpgitdrupalorgsandboxshiprawasson2435969git

Manual reviews of other projects:

1.https://www.drupal.org/node/2453657#comment-9728507
3. https://www.drupal.org/node/2427517#comment-9727939

Comments

shipra.wasson’s picture

Issue summary: View changes
shipra.wasson’s picture

Category: Bug report » Task
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.

shipra.wasson’s picture

Issue tags: -Needs Review +PAreview: review bonus
andrdrx’s picture

Manual review

  1. Individual user account - Yes: Application issue contains a link to the project page and a working "git clone" command.
  2. No duplication - Yes: Does not cause module duplication.
  3. Master Branch - Yes: Master branch is set proper to 7.x-1.x
  4. Licensing - Yes: Repository does not contain a ‘LICENSE.txt’ file.
  5. 3rd party code/content - No: Repository does not contain any 3rd party code.
  6. Project page docs- Please increase description: Project page contains not enough information. Please follow this guidelines.
  7. Repository contains a detailed README.txt- Maybe you can construct more detailed README.txt ?: Please follow this guidelines.
  8. Code contains a well-balanced amount of inline-comments - Yes Code contains inline comments and function comments.
  9. Code and Drupal API : In file usercancel_contentassigntootheruser,js, probably, the better way is to use Drupal behavior instead $(document).ready(). Please read this article, Behaviors section.
naveenvalecha’s picture

Status: Needs review » Postponed (maintainer needs more info)

Please specify your project difference with this project(https://www.drupal.org/project/usercancel_contentassigntoadmin). I have checked and found that the project only provides to select the user during the cancellation if it is only single extra difference then I would suggest to please collaborate with the module author of usercancel_contentassigntoadmin,As Module duplication and fragmentation is a huge problem on drupal.org and we prefer collaboration over competition. Please open an issue in the usercancel_contentassigntoadmin module and discuss with this feature. if the maintainers will not agree then re open this issue.
If have other differences other than I specified above then add a comment.
Manual Review (Commit 365587b):

  1. (*)usercancel_contentassigntootheruser_form_user_multiple_cancel_confirm_alter : It is not always sure that role id 3 will exist always.We can delete the role id 3 after the drupal vanilla installation.So I would suggest to keep it either 2(authenticated) as default because we cant't remove that role.
  2. (*)usercancel_contentassigntootheruser_form_user_multiple_cancel_confirm_alter : This function is returning the list of all users with particular role usercancel_contentassigntootheruser_get_users.If a drupal site has more than million of users with that particular role then that page will hang.So I would suggest to change the users_list select list to autocomplete field.
  3. usercancel_contentassigntootheruser_user_cancel : $userid = $edit['users_list']; If the user will select None value from the select list returned by function usercancel_contentassigntootheruser_get_users, then it will make break the update in this function usercancel_contentassigntootheruser_user_cancel because uid is a numeric field.I would suggest to remove the none option from the userlist array returned by usercancel_contentassigntootheruser_get_users function.
  4. usercancel_contentassigntootheruser.js : Use Drupal.behaviors, not jQuery(document).ready() in your js file. https://www.drupal.org/node/304258
klausi’s picture

Since we don't block applications on duplication anymore, this should go back to "needs review". If there is only this minor differences to the existing module, then we cannot give the git vetted user role away and will do a manual promotion of this single project.

@shipra.wasson: please reconsider contributing to the existing project or set this back to "needs review" if you must publish this as separate module.

naveenvalecha’s picture

Thanks @klausi,
So how are we going to deal with the old postponed applications ?

klausi’s picture

I think we can leave them as they are, the applicants can set them back to "needs review" if they want to.

PA robot’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

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

shipra.wasson’s picture

Status: Closed (won't fix) » Needs review
Issue tags: -PAreview: review bonus

Hi,

First of all sorry for taking so long. I have done all the improvement suggested by @naveenvalecha in Manual Review (Commit 365587b).

Also I would like to mention the difference between my module and (https://www.drupal.org/project/usercancel_contentassigntoadmin) is that this only allows you to transfer the content to admin, where as my module lets users to select role and then there is a auto suggest text field for finding user under that role and then the content can be shifted to new selected user.
For e.g. : If I have a manager has resigned in an organization and a new has been appointed in his place ,then the areas and divisions data can be easily transferred to new user.

naveenvalecha’s picture

Duplication is no longer a blocker now, so this application can be proceeded.please take additional bonus that would help speed up the process

polaki_viswanath’s picture

Nice module. Looks like RTBC +1

Thanks
Viswanath Polaki

shipra.wasson’s picture

Issue tags: +PAreview: review bonus

Adding Bonus.

klausi’s picture

Issue summary: View changes
Issue tags: -PAreview: review bonus

Removing review bonus tag, you have not done all manual reviews, you just pointed out a missing git clone link. Make sure to read through the source code of the other projects, as requested on the review bonus page.

andrew.mikhailov’s picture

Hello!
I think you need to rewrite your hook_menu like this:

function usercancel_contentassigntootheruser_menu() {
  // Path with autocomplete function for users.
  $items['user-list/autocomplete/%/%'] = array(
    'title' => 'Autocomplete for users',
    'page callback' => 'usercancel_contentassigntootheruser_list_autocomplete',
    'page arguments' => array(2, 3),
    'access arguments' => array('access content'),
    'type' => MENU_CALLBACK,
  );
  return $items;
}

Here you will pass 2 arguments:

  • 2 - role ID
  • 3 - user_mail

And so, you don't need to use args(2) - I think it's a bad style.
You need to correct your page callback to:

function usercancel_contentassigntootheruser_list_autocomplete($role, $string) {
  #your code.
}

For me it looks better and it more drupal way than earlier.
Thank you.
Best regards.

andrew.mikhailov’s picture

Status: Needs review » Needs work
naveenvalecha’s picture

Automated Review :

  • 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.

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
Yes : Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage
  1. usercancel_contentassigntootheruser.js : Drupal.behaviors.userCancel we should use the module_name namespace with in the Drupal.behaviours object.you can also use the $ instead of jQuery when accessing the values.
  2. Suggestion : Move hook_help to top of all the functions in .module file.
  3. usercancel_contentassigntootheruser_form_user_multiple_cancel_confirm_alter : Why default value 2(authenticated role), similarly in usercancel_contentassigntootheruser_get_users
  4. usercancel_contentassigntootheruser_list_autocomplete : Why this function needed can't use the user_autocomplete function

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.

Removing the PAReview: Single project promote tag and not changing status due to open questions.

PA robot’s picture

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

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

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

shipra.wasson’s picture

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

Hi Andrew.Mikhailov
Thanks for your review, I will fix these issues and will change the status.

PA robot’s picture

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

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

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

shipra.wasson’s picture

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

Hi,
I have done the changes as suggest by @naveenvalecha.
Coding style & Drupal API usage

  1. usercancel_contentassigntootheruser.js : Drupal.behaviors.userCancel we should use the module_name namespace with in the Drupal.behaviours object.you can also use the $ instead of jQuery when accessing the values. --> DONE
  2. Suggestion : Move hook_help to top of all the functions in .module file. --> DONE
  3. usercancel_contentassigntootheruser_form_user_multiple_cancel_confirm_alter : Why default value 2(authenticated role), similarly in usercancel_contentassigntootheruser_get_users --> default value has to be 2 because all users are by default authenticated users.
  4. usercancel_contentassigntootheruser_list_autocomplete : Why this function needed can't use the user_autocomplete function --> This is required as we need to get users of a particular role selected by user.

Thank you.
Best regards.

jyotisankar’s picture

Looks like RTBC +1

klausi’s picture

Status: Needs review » Fixed

manual review:

  1. project page is a bit short, please follow https://www.drupal.org/node/997024
  2. https://www.drupal.org/project/move_user and https://www.drupal.org/project/usercancel_contentassigntoadmin . This sounds like a feature that should live in the existing move_user project. Module duplication and fragmentation is a huge problem on drupal.org and we prefer collaboration over competition. Instead of publishing another duplicate project please open an issue in the move_user issue queue to discuss what you need. You should also get in contact with the maintainer(s) to offer your help to move the project forward. If you cannot reach the maintainer(s) please follow the abandoned project process.
  3. usercancel_contentassigntootheruser.js: not sure I understand this correctly but it looks like you want to hide certain input fields. That should be done with the Drupal #states API, no need to write custom JS for that. See https://api.drupal.org/api/drupal/includes!common.inc/function/drupal_pr...
  4. usercancel_contentassigntootheruser_menu(): doc block is wrong, this is not hook_help().
  5. usercancel_contentassigntootheruser_menu(): I think the permission is wrong, should be "access user profiles" instead.
  6. usercancel_contentassigntootheruser_list_autocomplete(): use @param to document parameters, see https://www.drupal.org/coding-standards/docs#param

But otherwise looks good to me.

Thanks for your contribution, Shipra!

I updated your account so you can create new projects as either a sandbox or a "full" project. As I already said please do not promote this particular sandbox, because it would duplicate 2 already existing projects. Please contribute to those instead!

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

hesnvabr’s picture

Found an errors in usercancel_contentassigntootheruser.module

FOUND 4 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------
166 | ERROR | [x] There must be exactly one blank line before the tags in
| | a doc comment
166 | ERROR | [x] Expected "string or int or object..." but found "type"
| | for parameter type
167 | ERROR | [ ] Parameter comment must start with a capital letter
167 | ERROR | [ ] Parameter comment must end with a full stop

Status: Fixed » Closed (fixed)

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

avpaderno’s picture

Title: accountcancel_contentassigntootheruser » [d7] accountcancel_contentassigntootheruser