Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
4 Jun 2026 at 19:43 UTC
Updated:
22 Aug 2026 at 11:40 UTC
Jump to comment: Most recent
Comments
Comment #2
avpadernoThank you for applying!
Before giving links helpful to understand how the review process works, what to expect from a review, and what to do to avoid a review takes more time than needed, I would like to thank all the reviewers for the work they do.
These applications are volunters-driven, which also means it is not possible to predict when an application will be marked fixed and the applicant will get the permission to opt projects into security advisory policy. While we aim to make an application as quick as possible, it is also important for us that more people review the project used for an application. In this way, we make sure applications do not miss some important points that should be instead reported.
Applications are not meant to be complete debugging sessions that eliminate every existing bug, though. I apologize if sometimes applications seem to go into too-detailed reviews.
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.
Keep in mind that once the project is opted into security advisory coverage, only Security Team members may change coverage.
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 #3
avpadernoFor these applications, we need a project where, in at least a branch, most of the commits (but preferably all the commits) have been done from the person who created the application.
The purpose of these applications is reviewing a project to understand what the person who applies understands about writing secure code which follows the Drupal coding standards and correctly uses the Drupal API, not what all the project maintainers collectively understand about those points.
Do you have a project for which most of the commits have been done by you in at least a branch? It also needs to contain enough Drupal-related-PHP code.
Comment #4
aaronrus commentedThe 2.0.1 branch which was originally the 2.x but forked so the Security review process would not hold up any possible work that might be done on the development branch. This is all my work from commit 8b28e6d20487aaf98a623001ff3403f45a7238c0 up. This was a rewrite from D8 to D10 and D11. 77 files changed, 3018 insertions(+), 1634 deletions(-) of code. No other maintainers have worked on the project in years. I'm not sure what the issue is. Please take a second look at this and advise what you are needing if this is not enough.
Thanks
Aaron
Comment #5
vishal.kadamI am changing priority as per Issue priorities.
Comment #6
solideogloria commentedComment #7
solideogloria commentedThe project as a whole: The project's default branch is master. This should be changed to the 2.0.1 branch or another branch. Also, Drupal doesn't allow "master" as a branch name anymore.
src/ForecastClient.php
Use constructor property promotion. Also, constructor doc block comments are optional and can be removed.
getPointsreturnsNULLon failure. That's procedural programming style. In object-oriented code, you should throw an exception so that it can be caught or handled by the caller or subclasses. Using an exception unique to the module is desirable if no core one fits, such asNwsWeatherExceptionor something. An example is how the Webform module usesWebformException. Don't forget to add@throwsto function comments that throw an exception.These might also apply to other files.
src/Form/NwsWeatherAdminSettings.php
With Drupal 10 and Drupal 11, there is no longer need to use #default_value for each form element, when the parent class is ConfigFormBase: It is sufficient to use #config_target, as in the following code.
Using that code, it is no longer needed to save the configuration values in the form submission handler: The parent class will take care of that.
src/Plugin/Block/MultiDayForecast.php
The indentation isn't quite right here:
Also, use constructor property promotion, etc. And if you use autowiring of services, you won't need the
createfunction, I think?Comment #8
solideogloria commentedComment #9
avpadernoA release branch name should end with the literal .x; names like 1.0.0 or 2.1.0-beta1 are for tags.
Comment #10
solideogloria commented(e.g. 2.0.x or 2.x)
Comment #11
aaronrus commentedRenamed branch from 2.0.1 to 2.0.x
Regarding the default branch. I am a co-maintainer and do not have access to set the default branch. Once we have a stable branch in the project I plan to ask the project owner to set the correct default branch or give me the access rights to do so.
Comment #12
vishal.kadamComment #13
aaronrus commentedThank you for the review and suggestions. I have pushed the follwing changes to 2.0.x
Replaced #default_value with #config_target for simple fields in NwsWeatherAdminSettings.
Added NwsWeatherException class.
Replaced NULL returns with throw NwsWeatherException in ForecastClient and ForecastDataProcessor.
Added try catch to MultiDayForecast.
Moved logging from ForecastClient to MultiDayForecast.
Added Autowire to NwsWeatherAdminSettings.
Removed optional constructor doc block comments.
Changed to constructor property promotion on ForecastClient, ForecastDataProcessor, NwsWeatherAdminSettings, MultiDayForecast
Fixed indentation on block attribute.
I think that is every thing If you see anything else please let me know.
Comment #14
vishal.kadam1. FILE: README.md
The README file is missing the required section - Requirements.
2. FILE: nws_weather.module
For a new module that aims to be compatible with Drupal 10 and Drupal 11, I would rather implement hooks as class methods as described in Support for object oriented hook implementations using autowired services.
It would require increasing the minimum Drupal 10 version supported, but Drupal 10.1 is no longer supported.
3. FILE: templates/nws-weather-forecast-block.html.twig
Strings used in template files must be translatable.
4. FILE: src/Form/NwsWeatherAdminSettings.php
Starting with Drupal 10.2, ConfigFormBase::__construct() requires two parameters and #config_target requires at least Drupal 10.3.
You need to update the drupal core requirement in nws_weather.info.yml file.
Comment #15
aaronrus commentedThank you, I have pushed the following changes to 2.0.x
Fixed requirements section in readme file.
Added object oriented theme hook implementation with Backwards-compatibility
Fixed translatable strings in template nws-weather-forecast-block.html.twig
Updated the core_version_requirement: ^10.3 || ^11
Comment #16
vishal.kadamRest seems fine to me.
Please wait for other reviewers and Project Moderator to take a look and if everything goes fine, you will get the role.
Comment #17
solideogloria commentedFixed branch name in issue summary
Comment #18
avpadernoComment #19
avpadernosrc/Form/NwsWeatherAdminSettings.php
$formis the parameter passed to the method. It is not initialized to an empty array, or it loses all the passed values.If a submitted value is required, it is sufficient to set the form element as required. It is correct to verify the submitted value does not contain just spaces, since in that case Drupal core would consider that as a valid string, but checking the submitted value is not empty is not necessary. Further more
empty()returnsTRUEfor values you would not expect it to returnTRUE.Probably, there are more values which should not be accepted. For example, a string containing only slashes (
////////////////) should probably be rejected. I imagine the absolute path for the submitted value should be checked too, or a value like../../../../../../../../../../../../../../would be accepted, although points to a directory that does not exist.For the first case, an error message like Image override directory does not exist or is not writable. Please create it manually inside the public files folder. does not say exactly what is wrong with the submitted value. (It is not that the directory does not exist; that directory name is not valid.)
For values that are expected to be integers, Drupal has a specific form element, which also allow to set a minimum and a maximum value.
Those lines and the next lines are not necessary.
src/Plugin/Block/MultiDayForecast.php
As with
$configFactory, it is suggested to use a property for the logger factory instead of the logger instance used by the class.The
$messageparameter passed to theLoggerInterfacemethods must be a literal string that uses placeholders. It is not a translatable string returned fromt()/$this->t(), a string concatenation, a value returned from a function/method, nor a variable containing an exception object.For exceptions, it is probably better to use
Error::logException(), which allows understanding exactly what caused the exception.src/ForecastClient.php
Methods defined in interfaces, or inherited by a parent class, use a simpler documentation comment, which eventually can use
@throwstags, when those are not already used by the interface or the parent class.@throwstags need to describe when the exception is thrown.Comment #20
avpadernoComment #21
aaronrus commentedI have pushed the following changes to 2.0.x
- Fixed: initializing form to an empty array.
- Fixed: submitted directory value should be required in the form element.
- Fixed: using !empty() on directory path variable.
- Fixed: verify the submitted value does not contain just spaces.
- Fixed: a string containing only slashes should not be accepted.
- Fixed: the absolute path for the submitted value should be checked.
- Fixed: error message for image override directory does not say exactly what is wrong.
- Fixed: lat and lon form element should set a minimum and a maximum value, removed validateForm().
- Fixed: Change to logger factory instead of logger instance.
- Fixed: The $message parameter passed to the LoggerInterface methods must be a literal string that uses placeholders. Replaced logger message with Error::logException().
- Fixed: Methods defined in interfaces, or inherited by a parent class, use a simpler documentation comment.
- Fixed: @throws tags need to describe when the exception is thrown.
I also made changes in the validateOverrideFileExists() method.
- Early return if directory path had errors.
- Check for invalid characters in filename.
- Strip path from filename.
- Verify the file is located inside the public directory.
Thank you for your time reviewing.
Comment #22
avpadernosrc/Form/NwsWeatherAdminSettings.php
Methods defined in a parent class or in an interface have a different documentation comment.
Documentation comments for form validation handlers just need the short description, which needs to describe which form or form element they validate.
@return voidis never used when a function/method does not have any return value. It is omitted, together its description.src/Plugin/Block/MultiDayForecast.php
Why only one parameter is defined
protected readonly?There is no need to reference the same issue twice. It is sufficient to use
until https://www.drupal.org/project/drupal/issues/2352009 is resolved.(keeping the line 80 characters).Comment #23
avpadernoComment #24
aaronrus commentedI have pushed the following changes to 2.0.x
Here is a link for reference https://git.drupalcode.org/project/nws_weather/-/commits/2.0.x/?ref_type...
- Fixed documentation in module file for hook_theme().
- Fixed cspell issue in ForecastClientInterface documentation.
- Fixed documentation by switching to short form {@inheritdoc} in NwsWeatherAdminSettings for buildForm().
- Fixed documentation by removing @param and @return in NwsWeatherAdminSettings for validateOverrideDirectory().
- Fixed documentation by removing @param and @return in NwsWeatherAdminSettings for validateOverrideFileExists().
- Fixed documentation by using short form {@inheritdoc} in NwsWeatherAdminSettings for submitForm().
- Fixed wording in the documentation for NwsWeatherException.
- Fixed incompatibility with dependency injection when the trait is used by a parent class on PHP less than 8.4 by removing readonly in MultiDayForecast for ConfigFactoryInterface.
- Fixed comment in MultiDayForecast regarding disabling page cache.
- Fixed documentation for nws-weather-forecast-block.html.twig.
Thank you for your patience reviewing my code.
Comment #25
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 also all the reviewers for helping with these applications.
Comment #26
avpaderno