Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
14 Jan 2020 at 11:10 UTC
Updated:
19 Feb 2020 at 09:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
antonín slejška commentedComment #3
ankush_03@Antonin,
If there is any dependency of any core/contrib module, Please specify in your info.yml file.
currently dependencies: (there is a blank value for dependency).
Comment #4
ankush_03Attached Screenshot.
Comment #11
avpadernoComment #12
avpadernoThank you for applying!
Check the Git settings you are using; in particular, verify the email Git is using is an email Drupal.org knows. Your commits aren't associated to your account, and that is because Git is not using an email registered within your Drupal.org account.
Comment #13
antonín slejška commentedHi Ankush,
there are no dependencies to other modules. See the tests, which work, when only opensearchtab module is installed:
public static $modules = ['opensearchtab'];The tests:
Comment #14
ankush_03@Antonin
So remove blank dependencies: key from info file.
Comment #15
antonín slejška commentedHi Kiam,
thanks for the remark. I have changed the git config for the project and the last commit is connected with my Drupal account.
https://git.drupalcode.org/project/opensearchtab/commits/8.x-1.x
Comment #16
antonín slejška commentedHi Ankush,
the dependencies are removed:
https://git.drupalcode.org/project/opensearchtab/blob/8.x-1.x/opensearch...
Thanks!
Comment #17
vernitI have reviewed manually and found below concerns :
1. src/Controller/OpenSearchDescriptionController.php - Code extended more then 80 column. Recommended to break smaller chunks to more readable.
2. Use dependency injection
Example of using:
First, use the namespace:
use Drupal\Core\Messenger\MessengerInterface;Than add protected variable to your class:
protected $messenger;In your constructor:
and then:
Then you can use
$this->messenger->addMessage($message, $message_status);in your code.
Thank you for your contribution.
Comment #18
ankush_03@vernit,
For point 2 You're talking about the same controller file? Becoz I didn't find anything related to drupal messages.
Comment #19
vernitMessage is for example point of view.
In file Drupal request is used.,
Comment #20
vernitComment #21
ankush_03ok @vernit
@Antonín Slejška is there any case for not extending controller base class in OpenSearchDescriptionController.php file.
$config = \Drupal::config('system.site');
you can also do it by extending controller base class :
Eg: $config = $this->config('system.site'); (This should avoid direct drupal calls)
Comment #22
antonín slejška commentedHi Vernit,
thanks for your suggestions:
Ad 1: I have implemented it with the help of PhpStorm Reformat File Dialog.
Ad 2: I have implemented the dependency injection for configs.
Comment #23
antonín slejška commentedI have implemented the dependency injection also for request and responce:
https://git.drupalcode.org/project/opensearchtab/blob/8.x-1.x/src/Contro...
Comment #24
crafter commentedHi, I have one issue. Maybe better idea would be put part of code from controller to any service beacuse this controller is too big, method content should be share.
I don't think so that contoller's role is creating xml. In my opinion you should put all creating xml functionality to another service. In controller you should only call:
Comment #25
avpadernoPutting the part for generating the XML content into a service would make the code more modular, and allow a third-party module to alter the XML content, but since the task of controllers is generating content, this is not something we can judge on these applications.
It's a great suggestion, though.
Comment #26
antonín slejška commentedHi Adam and Kiam,
I have implemented the service.
Thanks for the suggestion!
Comment #27
crafter commentedIn my opinion everything is good here. Maybe one thing yet but it's only suggestion. if I were you I would move raw numeric values to const in validateForm in your config form here but like I told before it is only suggestion.
Comment #28
antonín slejška commentedHi Adam,
I made an experiment with the constant. The problem is, that the constant can not be used in the translation method t(). See PAReview.
There are some possible solutions of this problem, but for me it seems too sophisticated.
Generally I have found the suggestion interesting. But I would like to make it more general. Any idea, how to solve the issue?
Comment #29
ankush_03@Antonín Slejška
You can try
use Drupal\Component\Render\FormattableMarkupRefer https://drupal.stackexchange.com/questions/220874/passing-variables-that...
Comment #30
antonín slejška commentedThank you Ankush,
the code looks cleaner and the PAReview displays no warnings now.
Comment #31
klausiThanks for you contribution!
Otherwise looks good to me, did not see any security issues.
Comment #32
antonín slejška commentedHi Klausi,
thanks for your suggestions. I have implemented them:
Comment #33
avpadernoThank you for your contribution! I am going to update your account.
These are some recommended readings to help with excellent maintainership:
You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
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 all the dedicated reviewers as well.
Comment #34
antonín slejška commentedThank You Kiam and all other reviewers for all your comments and suggestions. I found it really helpful!