Entity Usage Explorer is a module designed to accurately track and display where entities are being used throughout a site, based on the current revision of entities.
Features
-
Views Field Plugin:
- A customizable field plugin
Base Entity Usageto display entity usage counts. - Can be rendered as plain text or as a clickable link leading to the entity usage overview page.
- A customizable field plugin
-
Entity Usage Overview Page:
- Accessible at
/admin/usage/{entity_type}/{entity_id}. - Displays a list of all places where the entity is referenced.
- Lists entity usage across various types, including Menu Links, Nodes, Media, Block Content, Users, Paragraphs, etc.
- Accessible at
-
Operations Link:
- Adds a "Usage" operations link for all content entities.
Installation
- Install via composer (
composer require drupal/entity_usage_explorer) or download manually and place in the/modules/customdirectory. - Enable via UI from Extend page or enable via Drush using
drush en entity_usage_explorer
Similar Projects:
There is Entity Usage module which provides the similar functionality, but there are certain limitations in that project:
- It doesn't show the accurate usage on entities as per the current revision on entities.
- It doesn't show the usage when the entity is being used on Menu links, or User entity etc.
- To get the latest usage statistics, batch process need to be executed every time when changes are made on site.
The Entity Usage Explorer module addresses all the mentioned concerns by accurately tracking and displaying entity usage across Drupal site. It offers a user-friendly interface for reviewing entity usage and provides custom Views field that can be seamlessly integrated into Drupal Views for enhanced reporting and analysis. The module instantly reflects changes in entity usage overview page, ensuring that you always have up-to-date information.
Comments
Comment #2
keshav patel commentedI've gone through Apply for permission to opt into security advisory coverage page to understand all the requirements.
Changing status to "Needs review".
Comment #3
vishal.kadamThank you for applying!
Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.
The important notes are the following.
phpcs --standard=Drupal,DrupalPracticeon the project, which alone fixes most of what reviewers would report.To the reviewers
Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.
The important notes are the following.
For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.
Comment #4
vishal.kadamComment #5
vishal.kadam1. FILE: README.md
The README file is missing the required sections including Requirements.
2. FILE: entity_usage_explorer.module
The usual description for a .module file is “Hook implementations for the [module name] module”, where [module name] is the module name given in the .info.yml file.
3. FILE: templates/entity-usage-overview-page.html.twig
Twig code needs to be correctly indented. Drupal uses two spaces for indentation, not four spaces or tabs.
Strings shown in the user interface must be translatable. That holds true also for strings used in template files.
Comment #6
keshav patel commentedThanks for the feedback @vishalkadam.
Fixed all reported issues, please review.
Comment #7
vishal.kadamRest looks fine to me.
Let’s wait for a Code Review Administrator to take a look and if everything goes fine, you will get the role.
Comment #8
keshav patel commentedThanks for the review @vishal.kadam.
Also, as mentioned on What to expect from the review process section:
Please change the status to RTBC.
Comment #9
vishal.kadamComment #10
avpadernosrc/UsageService.php
None of those documentation comments are correct. A short description starting with Implements is for hook implementations. For other functions and methods, a documentation comment needs to contain at least a short description, a description of the parameters (if they are used), and a description of the returned value (if it is not
void).Drupal core does not query entity tables in that way, which is not necessary to verify a specific database table exists to then query it.
src/Controller/UsageOverviewController.php
Since that class does not use any method from the parent class, it does not need to use
ControllerBaseas parent class. Controllers do not need to have a parent class; as long as they implement\Drupal\Core\DependencyInjection\ContainerInjectionInterface, they are fine.Comment #11
keshav patel commentedHello @avpaderno, Thanks for a thorough review!
I've worked on suggested improvements, please check.
Comment #12
avpadernoI will review the project tomorrow.
Comment #13
avpadernoThank you for your contribution and for your patience with the review process!
I am going to update your account so you can opt into security advisory coverage any project you create, including the projects you already created.
These are some recommended readings to help you with maintainership:
You can find more contributors chatting on Slack or IRC in #drupal-contribute. So, come hang out and stay involved!
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.
I thank the dedicated reviewers as well.
Comment #14
avpaderno