Description

Block User is a module that displays user info throught an entity view display wherever you want on your site.

By default it displays the current logged-in user but you can select any other existing user.

The module provides a custom block with simple settings (see admin/structure/block).

Requirements

The module is dependent on two Drupal core modules:

  • Block
  • User

Links

Sandbox Project Link:

User Info Block

Setting up repository for the first time:

git clone --branch 8.x-1.x https://git.drupal.org/sandbox/matthieuscarset/2849852.git block_user_info

Reviews of other projects:

  1. https://www.drupal.org/node/2743377#comment-11930529
  2. https://www.drupal.org/node/2850757#comment-11930575
  3. https://www.drupal.org/node/2783927#comment-11930599

Comments

matthieuscarset created an issue. See original summary.

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.

matthieuscarset’s picture

Issue summary: View changes
matthieuscarset’s picture

Issue summary: View changes
matthieuscarset’s picture

Issue summary: View changes
Status: Active » Needs review
Issue tags: +PAreview: review bonus
tim.plunkett’s picture

This seems similar to http://www.drupal.org/project/entity_block, haven't dug in to see if it's a complete overlap.

scott.allison’s picture

Hi Matthieu, I would recommend a different name to avoid confusion. Block User sounds like a module to disable a user account. Here are a few (poor) ideas:

- User Info Block
- Current User Block
- User Avatar
- Mini-Profile Block

I remember creating something just like this using Views in Drupal 7. This module has to make this exceptionally easier, but perhaps there's a way to extend core functionality or another contrib module that allows for greater customization in the long run.

At this time I wouldn't recommend saying this is RTBC until the name is refined, but I also don't think this warrants the Needs Work status unless someone finds something significant in the source code. I did not test the functionality of the module, but below are my observations:

Automated Review

Best practice issues identified by pareview.sh: README.md file contains two lines that exceed 80 characters. Add a carriage return after 80 characters.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Please add a section to your application for similar projects and how they are different, include entity_block as noted by Tim, and also user_details and entity_view_mode. There might be more, this was just a limited scan.
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
Yes: Follows the guidelines for in-project documentation and/or the README Template. (see line count issue in automated review)
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.

This review uses the Project Application Review Template.

aloknarwaria’s picture

Status: Needs review » Needs work

Hi @matthieuscarset, Found Some minor issues with coder module given below.

1.
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
21 | WARNING | Line exceeds 80 characters; contains 786 characters
47 | WARNING | Line exceeds 80 characters; contains 147 characters
----------------------------------------------------------------------

Please find the complete detail on below URL regards the above issues.
https://pareview.sh/node/1082

2.
Please delete the block_user.module file. There is no point to keep the blank file in your module.

3.
In your BlockUserInfo.php file line number 106 I found the HTML link code please use the "Drupal::Url" function for the internal links.
You can <a href="/admin/structure/display-modes/view/add/user">add a new display mode here</a> and <a href="/admin/config/people/accounts/display">edit displayed fields there</a>.
Please find the reference code for the Drupal::Url is
https://api.drupal.org/api/drupal/core!lib!Drupal.php/function/Drupal%3A...

4
One more suggestion please avoid the double quote "
for example in your block_user.module file at line number 122
"By default, the block displays the current user's info."
replace with
'By default, the block displays the current user\'s info.'

Similar issue at line number 121 "Select a specific user." replace with 'Select a specific user.'

matthieuscarset’s picture

Status: Needs work » Needs review

Hi everyone and thank you very much for your reviews.

I've fixed everything and this module is now ready to obtain the RTBC status :)

Thank you @tim.plunkett for pointing me out to the Entity Block module.
It's similar to my module in some ways, but mine is more specific and therefore easier and faster to use for site builders.
My module answers specific needs:

  • Display the current user
  • Display a list of specific users
  • Display the current node's author

Thank you @scott.allison for your review.
I agree with the confusion about the module name.
It is a good idea to change it and I've chosen : User Info Block.

Thank you @aloknarwaria for your review.
I've fixed all warnings and errors found.
The module now passes all automated tests successfully.
I've also fixed the URL and typo in BlockUserInfo.php

jeetendrakumar’s picture

Status: Needs review » Needs work

@matthieuscarset

I found some errors:

FILE: ...ot/repos/pareviewsh/pareview_temp/src/Plugin/Block/BlockUserInfo.php
--------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------
231 | ERROR | [x] Expected 1 space after "=>"; 2 found
254 | ERROR | [x] Whitespace found at end of line
296 | ERROR | [x] Expected 1 space after "="; 2 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------
matthieuscarset’s picture

Status: Needs work » Needs review

Hi @jeetendrakumar and thank you for your quick review.

I've fixed those errors with PHPCS as per https://pareview.sh/node/1082

Looking forward to the RTBC status

matthieuscarset’s picture

Issue summary: View changes
matthieuscarset’s picture

Title: [D8] Block User » [D8] User Info Block
matthieuscarset’s picture

Issue summary: View changes
zyyz’s picture

BlockUserInfo.php : Found "@todo Configure block cache". Either implement the functionality or just remove the @todo.
BlockUserInfo.php : BlockUserInfo::currentNode is defined dynamically, class property should be defined explicity.

zyyz’s picture

Status: Needs review » Needs work
matthieuscarset’s picture

Hi @zyosarian

Regarding to @todo comment, I've already implemented the functionnality (see CHANGELOG.txt)
Just forgot to delete the comment.
Thank you for the reminder.

Regarding the "currentNode" property, it is explicitly declared now.

Although I really don't think those two comments were reasons to put my module as "Need work", I thank you for the time you've dedicated to review it.

matthieuscarset’s picture

Status: Needs work » Needs review
sjpagan’s picture

Status: Needs review » Reviewed & tested by the community

hi @matthieuscarset,
You must have patience, this is quite a long process, but these trifles guarantee quality code written by the community ...
I test your module, work fine

tim.plunkett’s picture

You should explain the differences to the existing solutions on the project page.
Rewording comment #9 above and putting it in a paragraph would be great!

matthieuscarset’s picture

Hi @sjpagan @timplunkett, thank you for your replies.

Compare to the Entity Block module, my module provides a more complete solution to display a user in a block.
Not only you can select the view mode, but you can also select which user you want to display.
You can also display multiple users and I'm working on a way to select users by role.

tim.plunkett’s picture

Yes. Please go to https://www.drupal.org/node/2849852/edit and put that information there.

matthieuscarset’s picture

I've added more details to the module presentation page as you can see here:
https://www.drupal.org/sandbox/matthieuscarset/2849852

Thank you for this advice.

visabhishek’s picture

Status: Reviewed & tested by the community » Fixed

Review of the 8.x-1.x branch (commit 9871968):

  • 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. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

All looks good for me.

Thanks for your contribution, matthieuscarset!

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.

visabhishek’s picture

Assigning Credits.

tim.plunkett’s picture

Project page *still* does not mention Entity Block.

matthieuscarset’s picture

I have added mention and link to the Entity Block module.
Thank you for the reminder @timplunkett.

matthieuscarset’s picture

Status: Fixed » Closed (fixed)