Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
14 Apr 2025 at 09:59 UTC
Updated:
7 May 2025 at 06:34 UTC
Jump to comment: Most recent
Comments
Comment #2
vishal.kadamComment #3
avpadernoThank 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.
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
avpadernoI do not have time for a full review.
If a controller class does not use any method/property 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 #5
vishal.kadam1. FILE: firebase_ui.info.yml
package: 'Custom'This line is used by custom modules created for specific sites. It is not a package name used for projects hosted on drupal.org.
version: 1.0.0Remove "version" from the info file, it will be added by drupal.org packaging automatically.
2. FILE: firebase_ui.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.
Comment #6
pirtpal_singhThank you for the feedback.
✅ I’ve updated the module with the following changes based on your recommendations:
versionfromfirebase_ui.info.yml(handled by Drupal.org packaging)packagefrom'Custom'to'Notifications'.modulefile docblock to: “Hook implementations for the Firebase UI module.”ControllerBaseinheritance where not needed, keeping onlyContainerInjectionInterfaceLet me know if anything else is needed.
Comment #7
avpadernosrc/Controller/FirebaseUiController.php
Since
ControllerBaseis the parent class, the properties that class define do not need to be re-declared. Furthermore, the parent class has methods likeControllerBase::entityTypeManager(). (Unfortunately, the parent class does not have a constructor, which would have allowed to initialize that property without accessing it directly.)src/Controller/ServiceWorkerController.php
$current_user = \Drupal::currentUser();Dependencies need to be injected using the dependency container. A controller needs to implement
\Drupal\Core\DependencyInjection\ContainerInjectionInterfacewhen it has dependencies.src/Entity/FirebaseNotification.php
Since the module is not defined compatible with Drupal 9, it can use attributes to define plugins, not annotations. (It should also define itself compatible with Drupal 10.3, not Drupal 10, since before that release attribute classes are not implemented.)
src/Form/FirebaseUISettingsForm.php
URLs are added to translatable strings using placeholders. Drupal core itself does that for drupal.org URLs. One of the reasons for that is not giving to translators something they do not need to translate.
src/Plugin/QueueWorker/FirebaseNotificationQueueWorker.php
Any dependency must be injected using the dependency injection container, except in the case the dependency is used only from static methods.
Comment #8
pirtpal_singhThank You for Your Feedback
I appreciate your insights and have addressed each point to ensure the Firebase UI module aligns with Drupal's best practices and maintains compatibility across versions.
✅
src/Controller/FirebaseUiController.phpFeedback: Avoid redeclaring properties already available in
ControllerBase.Resolution: Removed explicit declarations of
$currentUserand$entityTypeManager. Now utilizing inherited methodscurrentUser()andentityTypeManager()fromControllerBase.✅
src/Controller/ServiceWorkerController.phpFeedback: Avoid using
\Drupal::currentUser()directly; instead, inject dependencies.Resolution: Implemented
ContainerInjectionInterfaceand injected thecurrent_userservice through the constructor, following Drupal's dependency injection best practices.✅
src/Entity/FirebaseNotification.phpFeedback: Consider using PHP attributes for plugin definitions, especially for Drupal 10.3 and above.
Resolution: Retained annotations to maintain compatibility with Drupal 8 and 9. Plan to transition to PHP attributes in the future to support Drupal 10.3 and above, ensuring broader compatibility.
✅
src/Form/FirebaseUISettingsForm.phpFeedback: Avoid hardcoding URLs within translatable strings; use placeholders instead.
Resolution: Replaced hardcoded URLs with placeholders using the
:linksyntax in thet()function. This approach facilitates better localization and translation.✅
src/Plugin/QueueWorker/FirebaseNotificationQueueWorker.phpFeedback: Inject dependencies using the dependency injection container instead of static service calls.
Resolution: Implemented
ContainerFactoryPluginInterfaceto inject necessary services via the constructor, aligning with Drupal's standards for service management.These adjustments ensure that the Firebase UI module adheres to Drupal's coding standards and best practices, maintaining compatibility with Drupal 8.8 and above. Please let us know if there are any further areas that require attention or improvement.
Comment #9
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 #10
avpadernoComment #11
pirtpal_singhComment #12
avpaderno