Description

The Masqueradedit module is a simple module that interacts with the Masquerade module to allow a user with the correct permissions to edit a node whilst masquerading as its author.

The Masquerade module provides a simple framework for a user to view a Drupal site as another user, but the process for editing a node as its author has a long tail: find the node, identify the author, find the author, masquerade as that author, find the node again, edit the node. Masqueradedit is intended to simplify that process by providing a single-click function to edit the node as its author, and return to your actual user account when leaving the node edit form.

Project page

https://drupal.org/sandbox/mrdalesmith/2170047

Git repo

git clone --branch 7.x-1.x
http://git.drupal.org/sandbox/MrDaleSmith/2170047.git masqueradedit
cd masqueradedit

Comments

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.

msmithcti’s picture

Status: Needs review » Needs work

Ran the project through http://pareview.sh/, a couple of minor issues:

There is still a master branch, make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch, see also step 6 and 7 in http://drupal.org/node/1127732
Review of the 7.x-1.x branch:

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

FILE: /var/www/drupal-7-pareview/pareview_temp/README.txt
--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
43 | WARNING | Line exceeds 80 characters; contains 97 characters
--------------------------------------------------------------------------------

DrupalPractice has found some issues with your code, but could be false positives.

FILE: /var/www/drupal-7-pareview/pareview_temp/masqueradedit.module
--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
93 | WARNING | Unused variable $revision_uid_updated.
--------------------------------------------------------------------------------

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
Source: http://pareview.sh/ - PAReview.sh online service

MrDaleSmith’s picture

Cheers for the review: I *think* those two errors are false positives: the 97 character line is caused by a long URL - the only way I could fix is to use a link shortener, which might cause security concerns for some users. The unused variable is at DB update with an ->execute.

Updated the repo to remove the master branch.

Thanks again!

pds

deepakaryan1988’s picture

Hi MrDaleSmith,
I have check it on my local machine, it is working fine. I didn't find any bug though which is great!!!
:)

deepakaryan1988’s picture

Status: Needs work » Reviewed & tested by the community
MrDaleSmith’s picture

Cheers Deepak.

pfaocle’s picture

> 93 | WARNING | Unused variable $revision_uid_updated

Could this be avoided by not assigning the return value to anything? It would contain the number of rows affected, which isn't subsequently used.

MrDaleSmith’s picture

Obviously I'm an idiot - of course I can use the return from that DB call. Thanks pfaocle: I'll make a change ASAP.

DavidPetit’s picture

Hi !

First of all, you can improve the git description in this topic by replacing:

http://drupalcode.org/sandbox/MrDaleSmith/2170047.git

by:

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/MrDaleSmith/2170047.git masqueradedit
cd masqueradedit

Concernning the README.txt file, it's good and very detailed. Concerning the tabs, I think you can warn user that they have to display tabs in their theme. It can happen that a theme hides or does not display tabs (or use custom links for admin/edit links).

When using it, it was working as designed. I think the default tab title should be "edit as author". With "edit as user" we don't understand which user it's about.

Moreover, I think it would be great to have this edit link in contextual links (for nodes teasers for example).

Concerning the code in the module, you should put the title in the hook_menu in t(), so that it's tranlatable.

That's all I see. Thanks for this module which can be really useful when you need to edit a node as the author.

MrDaleSmith’s picture

Issue summary: View changes

Cheers for that David - some good suggestions, which I'll get into the code. Just one thing though - hook_menu titles shouldn't be enclosed in t(), as the title callback defaults to t(). You get an error in codesniffer if you do enclose it.

DavidPetit’s picture

Yes, you're right ! The callback defaults to t() as stated in there : https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func...

kscheirer’s picture

Status: Reviewed & tested by the community » Fixed

Non-blocking issues:

  • You can remove the .gitignore file
  • I don't think you need the module_exists('masquerade') check in masqueradedit_access(). Since it's declared as a dependency, it will always be enabled when your module is running
  • In masqueradedit_menu() it would be very cool if you used a title callback to dynamically set the tab title. Then if the author was user "johndoe" the tab would read "Edit as johndoe" and so forth.

Thanks for your contribution, MrDaleSmith!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

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.

MrDaleSmith’s picture

Wow - magic: thanks kscheirer. Will get those improvements added.

Status: Fixed » Closed (fixed)

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