- Issue created by @spencer95@gmail.com
- ๐ฎ๐ณIndia vishal.kadam Mumbai
Thank 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.
- If you have not done it yet, you should run
phpcs --standard=Drupal,DrupalPractice
on the project, which alone fixes most of what reviewers would report. - For the time this application is open, only your commits are allowed.
- The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status won't be changed by this application and no other user will be able to opt projects into security advisory policy.
- We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.
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.
- It is preferable to wait for a Code Review Administrator before commenting on newly created applications. Code Review Administrators will do some preliminary checks that are necessary before any change on the project files is suggested.
- Reviewers should show the output of a CLI tool โ only once per application.
- It may be best to have the applicant fix things before further review.
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 โ .
- If you have not done it yet, you should run
- ๐ฎ๐ณIndia vishal.kadam Mumbai
1. FILE: README.md
The README file is missing the required sections โ , - Requirements.
2. FILE: README.txt
Remove README.txt since README.md is present.
3. FILE: fleetview_client.module
/** * @file * Fleetview client module. * * @author Dylan James */
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.
/** * Implements hook_menu(). */ function fleetview_client_menu() { $items = []; $items['admin/config/system/fleetview_client'] = [ 'title' => 'System Status', 'description' => 'Configuration for the Fleetview client module', 'route_name' => 'fleetview_client.admin_settings', 'type' => MENU_LOCAL_TASK | MENU_NORMAL_ITEM, ]; return $items; }
This is deprecated code written in the Drupal 7 and should be removed.
4. FILE: src/Controller/FleetviewClientController.php
/** * FleetviewClientController constructor. * * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler to invoke the alter hook with. * @param \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler * The theme handler. * @param \Drupal\fleetview_client\Services\FleetviewClientEncryption $encrypt * The system status encrypt service. * @param \Drupal\update\UpdateManagerInterface $updateManager * The update manager. * @param \Drupal\Core\State\StateInterface $state * The state storage service. * @param \Drupal\system\SystemManager $systemManager * The system manager. */ public function __construct(ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler, FleetviewClientEncryption $encrypt, UpdateManagerInterface $updateManager, StateInterface $state, $systemManager) {
The documentation comment for constructors is not mandatory anymore, If it is given, the description must be โConstructs a new [class name] objectโ, where [class name] includes the class namespace.
- ๐ฌ๐งUnited Kingdom spencer95@gmail.com Swansea/Cardiff
Thanks for taking time to review. I've fixed those issues.
- ๐ฎ๐ณIndia vishal.kadam Mumbai
Rest 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.
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
- The following points are just a start and don't necessarily encompass all of the changes that may be necessary
- A specific point may just be an example and may apply in other places
- A review is about code that does not follow the coding standards, contains possible security issue, or does not correctly use the Drupal API
- The single review points are not ordered, not even by importance
src/Controller/FleetviewClientController.php
// Add status report data. $system_info_controller = new SystemInfoController($this->systemManager);
Controllers are not part of the public API and are not created by directly calling the class constructor.
src/Form/FleetviewClientSettingsForm.php
$form['fleetview_client_service'] = [ '#type' => 'textfield', '#title' => $this->t('Connection token'), '#description' => $config->get('fleetview_client_token') . "-" . $config->get('fleetview_client_encrypt_token'), '#default_value' => $config->get('fleetview_client_token') . "-" . $config->get('fleetview_client_encrypt_token'), '#attributes' => ['style' => ['display:none;']], '#size' => 60, '#maxlength' => 60, '#disabled' => TRUE, ];
Neither fleetview_client_token nor fleetview_client_encrypt_token is saved.
src/Services/FleetviewClientEncryption.php
$encryptionToken = \Drupal::config('fleetview_client.settings')->get('fleetview_client_encrypt_token'); $key = hash("SHA256", $encryptionToken, TRUE);
fleetview_client_encrypt_token is not saved. Configuration objects are for values that are changed via a form.
fleetview_client.module
Either the
hook_help()
implementation gives more details, or it can be removed. - ๐ฌ๐งUnited Kingdom spencer95@gmail.com Swansea/Cardiff
Thanks avpaderno. These issues have now been refactored and fixed.
I have removed the settings form, and replaced the usage of config with state. - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
I will review the project tomorrow.
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
fleetview_client.info.yml
core : 8.x core_version_requirement: ^8 || ^9 || ^10 || ^11
core : 8.x
cannot be used togethercore_version_requirement: ^8 || ^9 || ^10 || ^11
. Drupal core would throw an error.fleetview_client.module
$output .= '<li>' . t('Go to Configuration > System > Fleetview client (<a href="/admin/config/system/fleetview-client">Fleetview client</a>)') . '</li>';
href
attributes are entered in a translatable string as placeholders.
There is no need to repeat'Fleetview client'
. It is sufficient to give the link with the first occurrence of that string.src/Controller/FleetviewClientController.php
Since that class does not use any method from the parent class, it does not need to use
ControllerBase
as parent class. Controllers do not need to have a parent class; as long as they implement\Drupal\Core\DependencyInjection\ContainerInjectionInterface
, they are fine.src/Controller/FleetviewTokenController.php
Since this class uses just a method from the parent class, it does not need to use
ControllerBase
as parent class. As for the other class, it can just implement\Drupal\Core\DependencyInjection\ContainerInjectionInterface
and define a new property.return [ '#type' => 'markup', '#markup' => '<p>' . $this->t('Copy the token below and paste it in the environment Token field on your Fleetview dashboard') . '</p>' . '<p>' . $token . '</p>', ];
Instead of concatenating a translatable string with another string, the translatable string should use a placeholder.
src/Services/FleetviewClientEncryption.php
$iv = openssl_random_pseudo_bytes(16);
There is no need to hard code the IV string length.
openssl_cipher_iv_length()
returns the expected IV length for any supported encryption algorithm. - ๐ฌ๐งUnited Kingdom spencer95@gmail.com Swansea/Cardiff
Thanks avpaderno. I've now made those updates.
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
Thank 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:
- Dries โ ' post on Responsible maintainers
- Maintainership โ
- Git version control system โ
- Issue procedures and etiquette โ
- Maintaining and responding to issues for a project โ
- Release naming conventions โ .
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.
- Assigned to apaderno
- Status changed to Fixed
16 days ago 10:39am 2 May 2025 Automatically closed - issue fixed for 2 weeks with no activity.