Synopsis
Hovercard is a module which is based on hovercard which is a free light weight jQuery plugin that enables you to display related information with the hovered label, link, or any html element of your choice. This module extends Drupal to provide Hovercard for the users of the website.
- Easy to install and use.
- Works on all user links with
usernameas their class. - Simply install it and see the magic!
Special thanks to Prashant Chaudhary for such a charming jQuery Hovercard Plugin!
Project Page
This is the project page link for Hover Card
Clone Repository
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/RishiKulshreshtha/2308117.git hover_card
Dependencies
Installation
The Hover Card module is very similar to other Drupal modules which requires Libraries Module to use for the 3rd party code integration. Hence, for installation of the Hover Card module please follow the below mentioned steps:
- Install as usual, see https://www.drupal.org/node/1294804 for further information.
- Download and install the Libraries Module - 2.x and after the module installation create a new folder called
librariesunder yoursites/all/folder. (Creating this folder will help us to locate our 3rd party code integration.) - Download the compressed version of jQuery Hovercard Plugin and extract the files into
sites/all/libraries/hover_card/ - Now, in your
sites/all/modules/sandbox/directory download the Hover Card module using GIT clone codegit clone --branch 7.x-1.x http://git.drupal.org/sandbox/RishiKulshreshtha/2308117.git hover_card. - Enable the Hover Card module.
Configuration
- After enabling it please check your
admin/reports/statuswhere there should a new option showingHover Card Plugin - v1.0 installedwith a success (Green) status. - This module has menu or modifiable settings. There is configuration link for this which you can access at admin/config/people/hover-card. When enabled and configured properly, this module will display the hover card to the user links with 'username' as class to their anchor tags. To disable the hover card from user links, disable the module and clear caches.
Code Review
Similar Project
There is a similar sandbox project called User Hover Card by Yannick Leyendecker which is dependent on Tipsy module. This module displays the user detail on a tooltip.
Preview

Reviews of other projects
https://www.drupal.org/node/2256993#comment-9196695
https://www.drupal.org/node/2347967#comment-9198771
https://www.drupal.org/node/2086333#comment-9193001
https://www.drupal.org/node/1914020#comment-9192875
https://www.drupal.org/node/2328917#comment-9235289
https://www.drupal.org/node/2370863#comment-9330763
https://www.drupal.org/node/2369363#comment-9333113
| Comment | File | Size | Author |
|---|---|---|---|
| #31 | hover-card-proof.jpg | 53.63 KB | rishi.kulshreshtha |
| #30 | hover_issue.png | 13.93 KB | rashid_786 |
| #10 | logged_in_user_hover.png | 16.68 KB | pushpinderchauhan |
| #10 | Anonymous_user.png | 16.26 KB | pushpinderchauhan |
| hover-card-bartik.jpg | 66.86 KB | rishi.kulshreshtha |
Comments
Comment #1
rishi.kulshreshthaComment #2
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxRishiKulshreshtha2308...
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.
Comment #3
rishi.kulshreshthaAs per the automated message, I've fixed all of the errors from the error list. Thanks.
Comment #4
sawtell commentedHi Rishi,
As your module is using a 3rd party library, you should look at using the Libraries module to include the hovercard plugin. https://www.drupal.org/project/libraries
I'm not sure what the best practice is for callback URL structures but you may want to change this to reduce the chances of a conflict with content aliases.
hover_card.js
$('.hover-details')is used multiple times and should be assigned to a variable for efficiency.Including a CSS file rather than inline styles would be preferable.
Lastly, you may want to consider using theme functions to return the contents of the hover card. This will allow developers to alter the display without need to hack the module.
Good luck with your submission,
Louis
Comment #5
rishi.kulshreshthaUpdated the Description of the page according to the new version.
Comment #6
rishi.kulshreshthaI've implemented solutions for all the mentioned points by Louis (ls206).
Thanks for sharing them! :-)
Comment #7
laceysanderson commentedHi Rishi,
Automated Review
You still need to set the default branch of your repository. To do this edit your sandbox project and click on the green "Default branch" tab near the top. Then just select the 7.x-1.x branch and save. Other than that the review is clean :)
Manual Review
Individual user account: Yes.
Master Branch: Follows guidelines. Mentioned setting the default branch above.
Licensing: None included (Follows guidelines).
3rd party code: Doesn't look to contain any. Uses the Libraries API to load an external jQuery library.
README.txt/README.md: You should add a configuration section even if no configuration is needed; See https://www.drupal.org/node/2181737 under "Configuration".
Security: Not any that I see...
Code long/complex enough for review: Yes. Meets minimum requirement of 5 functions and >120 lines.
Coding style & Drupal API usage: Passes the automated reviews. Also, uses the libraries API and various other Drupal hooks.
In reference to the hover_card() callback:
I think the description of this callback isn't as clear as it could be. What you appear to be doing is using "Drupal Magic" to fetch the user data via the Menu System %user argument and then rendering that content into a hover card. There does not appear to be any JSON involved. Also, you use the $user_fields variable when you should use the $user variable to make it clear that this is the $user object loaded via the menu system. The code on lines 98-100 looks incorrect/brittle to me - a short comment could go a long way here. What do you expect to be in the second position of the users roles & how are you sure it will always be there? Also, I think the brackets around $value are unnecessary; is this correct?
Additional Minor Comments
Comment #8
rishi.kulshreshthaUpdating the Description as per the changes.
Comment #9
rishi.kulshreshthaThanks for such a good and detailed review Lacey Sanderson. I'll always appreciate your effort :-)
I've implemented the changes according to the Automated Review provided by you.
Regarding the Manual Review:
Overall, once again thanks to Lacey Sanderson and all other mates for reviewing this module.
Comment #10
pushpinderchauhan commented@ Rishi Kulshreshtha, thankyou for your contribution!
Your module well worked for me, Good Job!
Automated Review
Best practice issues identified by pareview.sh / drupalcs / coder. Just one minor
Manual Review
hover_cardfunction, you are using$arrayvariable to hold user data, better to use some meaningful name like $user_data or vice-versa.Admin User:
Anonymous User:

It work fine as intended. Personally one more thing you can enhance here, If you look into source code for anonymous user, would found every js and css of this module loading on every page that are unused. I think it can be improved to load all necessary files only for logged in users :)
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.
As I am not a git administrator, so I would recommend you, please help to review other project applications to get a review bonus. This will put you on the high priority list, then git administrators will take a look at your project right away :)
As there is no blocker found, so moving to RTBC.
But I would give one suggestion to you, if you implement your JS file logic with Drupal Ajax framework would be nice. Ajax framework commands provides every possible commands that your require to implement your ajax logic.
Thanks Again for contributing this nice module.
Comment #11
rishi.kulshreshthaHearty thanks to Pushpinder Rana for reviewing the module and notifying me the issues.
I have fixed all the points mentioned by Pushpinder, which are as follows:
hover_cardfunction, replaced$arrayvariable which is used to hold user data with$user_dataas its more meaningful. Thanks Pushpinder for suggesting this.Comment #12
rishi.kulshreshthaComment #13
rishi.kulshreshthaComment #14
rishi.kulshreshthaComment #15
rishi.kulshreshthaComment #16
madhusudanmca commentedHi Rishi Kulshreshtha,
Thanks for your contribution.
I don't see any blockers for this module, however I see one PII (Personally identifiable information) concern here, as we are not giving any options to show/hide user data on that information overlay and directly exposing user's email address to other users.
I suggest you to edit your project page and clearly mention that "If you have PII compliance then do not use this module" or provide options show/hide user data.
Thanks
Comment #17
rishi.kulshreshthaThanks for the suggestion @Madhusudan, I've updated the code and created a new section "Configuration" where now its upto user whether to display the Emails or not.
Comment #18
rishi.kulshreshthaUpdated the code as per the requirement and also updated the "Configuration" with the updated details.
Comment #19
rishi.kulshreshthaAs there is no blocker found, so moving to RTBC.
Comment #20
pushpinderchauhan commentedPlease don't RTBC your own issues, see the workflow: https://www.drupal.org/node/532400.
Please treat these rules with understanding and be patient.
Comment #21
rishi.kulshreshthaMy bad, thanks for informing Pushpinder.
Comment #22
rishi.kulshreshthaComment #23
rishi.kulshreshthaFixed conditioning in
tpl.phpin the latest Commit ID #b6466e4. What I've found that though the user picture was not present but still the HTML with class nameuser-imagewas getting generated, hence its fixed now.Comment #24
sendinblue commentedAutomated Review
No issues.
Manual Review
Comment #25
klausiReview of the 7.x-1.x branch (commit b6466e4):
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.
manual review:
Comment #26
sendinblue commentedHello @klausi
I found one problem in your manual review.
10. "variable_get('hover_card_user_email_display_status', TRUE)": all variables defined by your module need to be removed in hook_uninstall().
Please check following article.
-----------------------------------------------------------
https://www.drupal.org/node/1187664#issues
Your module doesn't remove the Drupal variables it defines.
Drupal 6 modules can implement hook_uninstall() to remove Drupal variables it defines, and the database tables it installed; in Drupal 7, database tables defined from a module are automatically removed.
-------------------------------------------------------------
As you see in the article, I think Drupal 7 automatically remove all varialbes used in module when uninstall it.
Am I wrong?
Comment #27
pushpinderchauhan commented@sendinblue
In Drupal 7, database tables defined from a module are automatically removed, not variables. The variables that the module has set using variable_set() or system_settings_form() should remove on uninstall. Database tables defined by hook_schema() will be removed automatically.
See: https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func...
Comment #28
sendinblue commented@ er.pushpinderrana
Thanks very much for your info.
Really I'm a newbie for drupal. (my experience is 2 month) :)
I'll correct my sandbox project too as your info.
Regards
Comment #29
rishi.kulshreshtha@klausi,
I've fixed the issues mentioned in comment #25
Thanks for your review, great work!
Comment #30
rashid_786 commented> /**
* @file
* Install, update and uninstall functions for the hover_card module.
*/
unable to find install and update functions inside hover_card.install file as you mentioned in comments.
Why print_r() is being used to render $user_picture in hover-card-template.tpl.php and it would be nice if you say hover-card.tpl.php
* If i enable user picture and hover user profile name then it doesn't show any thing in username and email but roles as 'anonymous user' though already logged in as admin. Please find attached image for reference.
Comment #31
rishi.kulshreshtha@rashid_786,
First of all thanks for your suggestions, I've taken them into consideration and I've fixed couple of things:
@filesection ofhover_card.installfile.print_r()was necessary as you can see that I've set$details['picture']in$user_picturevariable in my template file.hover-card-template.tpl.phptohover-card.tpl.php.Comment #32
klausimanual review:
The unprotected menu path is a security blocker right now. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #33
rishi.kulshreshthaComment #34
rishi.kulshreshtha@klausi, thanks for the review. I've fixed all the issues mentioned by you and I've updated the same. Adding a new review of other project.
Comment #35
rishi.kulshreshthaComment #36
klausiReview of the 7.x-1.x branch (commit 2e9c616):
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.
But otherwise looks good to me now.
Assigning to stBorchert as he might have time to take a final look at this.
Comment #37
sandeep.kumbhatil commentedAutomated Review
Manual Review
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.
Comment #38
rishi.kulshreshtha@klausi & @sandeep.kumbhatil,
I've fixed the above mentioned issue, thanks for mentioning that.
Comment #39
stborchertThanks for your contribution, Rishi!
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.
Some small notes:
$useris not an array but should always be an object.Comment #40
stborchertForgot to set status.