Nodeinfo is a small and simple module that displays important, usually hidden information about currently viewed node for editors/administrators (permission configurable).
Of the shown information especially NID is very handy to know when for example content editing team wants to inform developers about an issue on a certain page. Displayed informational message allows easy way to copy the node's node/123 URL to clipboard. With a normal Drupal installation content editors may not know how to find the node's node/NID path they usually just copy path alias when sharing links internally -> this may cause 404's if alias changes and no redirect is created (very valid scenario during website development/staging).
Nodeinfo also displays the node changed date and tells if the node is sticky or promoted to homepage. Drupal 7 version integrates with domain access module informing user(s) about the domain(s) the node is published to.
I have not found similar modules from https://www.drupal.org/project/project_module and this has definitely been helpful small extension for our Drupal projects at work.
Project page: drupal.org/sandbox/kirkkala/2078927
Git (D8):
git clone --branch 8.x-1.x https://git.drupal.org/sandbox/kirkkala/2078927.git nodeinfo
Git (D7):
git clone --branch 7.x-1.x https://git.drupal.org/sandbox/kirkkala/2078927.git nodeinfo
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | recom.png | 126.87 KB | kajalkiran |
| #4 | Screen Shot 2017-01-02 at 4.49.54 am.png | 84.59 KB | kajalkiran |
| #4 | Screen Shot 2017-01-02 at 4.36.26 am.png | 179.59 KB | kajalkiran |
| #4 | D7_pa_error.png | 141.62 KB | kajalkiran |

Comments
Comment #2
kirkkalaComment #3
PA robot commentedWe 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 #4
kajalkiran commentedHi @kirkkala,
I have reviewed your module. Following are the feedback for the same :
Automated Review
Manual Review
Individual user account
Coding style & Drupal API usage
List of identified issues:- Found issues after testing the module with coder module. Few minor errors :

Recommendations for Application Issue
Comment #5
kajalkiran commentedComment #6
kirkkalaComment #7
kirkkalaThanks a lot @kajalkiran for your review. I've fixed pareview.sh errors from 7.x-1.x branch & made the main nodeinfo message fully translatable.
Your idea of showing nodeinfo in configurable view-block sounds nice but I don't really see much added value and keeping the module simple is the key here. Or if this really gets popular then later adding configurable alternative to show the info in configurable block.
Nodeinfo visibility is already configurable via Drupal permissions (
view node info).Comment #8
kirkkalaComment #9
harika gujjula commentedHi kirkkala,
The module is working fine as mentioned in the description
It would be good if we have the hook_help for the module
Comment #10
kirkkalaThank you harika gujjula for your review and good tip on missing hook_help(). I added that for both D7 & D8 branches.
Comment #11
ankush_03Hi kirkkala,
I have review you d7 branch, please find below details :
Please add
t()function on line 57$pub_status = ' <em>unpublished</em> ';Please add
t()function on line 87$ad .= ' <strong>Assigned to all domains</strong><br />';Please add
t()function on line 113$ad .= $delimiter . '<em title="' . $domain['sitename'] . '">' . $pt . '</em>';Comment #12
prashant114606 commentedHi kirkkala,
In d8 no need to write the hook_permission inside .module file instead of that you can use modulename.permission.yml which you have already implement.
File:
nodeinfo.module
20
The above code looks like its not required. It is recommended to remove the above code.
Comment #13
kirkkalaagautam, thanks for review - D7 branch all strings are now ran through t(). The last one though I don't see any added value translating since all output comes from domain access configurations.
Comment #14
kirkkalaprashant114606, thanks for the review. Indeed hook_permissions() is unnecessary with D8 - seems I just forgot it after running moduleupgrader.. Deleted from D8 branch,
Comment #15
jaykandariHi kirkkala,
Here is my review report about 8.x-1.x branch !! The overall code looks good. The only issue I found here is the length of code. While it's not mandatory to have a specific minimum code length. Kindly have a look at "guidelines for project length" page to get a general idea about how much code one should at least put in else it seems good to issue RTBC to this issue.
Thanks !! :)
Automated Review
Ran 8.x branch thru pareview.sh It showed no errors/warning: https://pareview.sh/node/664
Manual Review
phpcs. It returned no warnings/errors.This review uses the Project Application Review Template.
Comment #16
aloknarwaria commentedHi
Please find the comments below
1. In your current, you have used the "hook_preprocess_page" hook as in drupal 8 the event subscriber is recommended.
It is recommended to use the
eventsubsriber" for the same.Comment #17
visabhishek commentedThese are surely not a application blockers, anything else that you found or should this be RTBC instead?
Comment #18
aloknarwaria commentedHi @kirkkala,
The module is working fine for me, Please find my comment/suggestions on over the same.
1. It will be good if you can provide the edit on message.
2. Currently, you are using "drupal_set_message" function. This method have the
\Drupal::service('page_cache_kill_switch')->trigger();code, that does not all me to cache the pages.So it's a suggestion if your module provides the block integration to display the messages then the cache issues is resolved.
3. Please try to avoid the unwanted hooks "hook_preprocess_page" as they may be deprecated in future drupal versions.
Otherwise, the module is working fine. Good work. :)
Comment #19
kirkkalaThanks for the feedback. As suggested I removed hook_preprocess_page and use eventsubscriber instead (8.x-1.x only).
Comment #20
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpsgitdrupalorgsandboxkirkkala2078927git
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #21
kirkkalaOops, fixed the few warnings though some "possible false positives" still left.. Appreciated if someone could guide how to fix and/or if even needed in this case?
Comment #22
Entaro commentedHello,
After reviewing Drupal 8 version of module I must say that I agree with @kajalkiran, creating a block that can be assigned to any region sound much better then displaying information about node using drupal_set_message(). In this case you could also avoid hooking into KernelEvents. This is only suggestion so decision is up to you.
In order to fix your problem with dependency injection you can pass additional arguments to your service, this is example how inject route_match, modify nodeinfo.services.yml
And then inside NodeInfo class define protected variable $routeMatch and initialise it inside constructor so you class looks something like this
After you do it you can replace this code
$node = \Drupal::routeMatch()->getParameter('node');with this one
$node = $this->routeMatch->getParameter('node');Comment #23
narendrarIs it similar to:
https://www.drupal.org/project/about_this_node
https://www.drupal.org/sandbox/narendra23/2702411
Comment #24
kirkkalaThanks @entaro for your good example on dependency injection, I fixed all occurrences of \Drupal calls to fully pass CS.
Will work later to get a display of nodeinfo via block as suggested by already a few members. I guess it makes sense..
Comment #25
narendrarAlso , please check if this module is duplicate of https://www.drupal.org/project/about_this_node or not.
I have already created a port of drupal 8 and waiting for the maintainer to provide me access of project.
Comment #26
PA robot commentedClosing 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.
Comment #27
avpaderno