Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
11 Nov 2021 at 05:40 UTC
Updated:
2 Dec 2021 at 05:52 UTC
Jump to comment: Most recent

Comments
Comment #2
avpadernoThere is no need to use a custom class loader. As long as the classes are written in the correct directory and the correct file, they are automatically loaded from Drupal.
Why is a setting form built using a controller class instead of a form class? Drupal uses form classes to show forms.
The Drupal way of controlling the access to routes is using a permission or a custom route access checker, as described in Custom route access checking.
An event handler doesn't implement
create()like every service defined in a .services.yml file.The documentation comment needs to document the returned value.
Is the code correctly disallowing the permission, or is the logic incorrectly converted? administer isn't an existing permission. The code should rather check the permissions an account has, not its roles.
Even in AJAX forms, the form submission handler is still
submitForm().Since that is a method defined in the parent class, the document comment just needs to be inherited from the parent method.
When a form element is required, users cannot avoid to enter a value for that element. That code isn't necessary.
The namespace is wrong. The namespace of a module whose machine name is wtotem starts with Drupal\wtotem.
It doesn't seem the class is a controller, as it's not used in any route. Only controller classes can extend
ControllerBase.As per Drupal coding standards, method names aren't prefixed by m.
Controller classes use DI. In the case of the request object, that is automatically injected in the class constructor, if that uses a specific argument, as described in Routing API (Route controllers for simple routes).
Comment #3
avpadernoComment #4
yeonik commentedHello, apaderno,
You asked:
Let me clarify. Tell me, please, is it possible to add a header and a footer to the form classes?
Comment #5
avpadernoA form can contain any render item, including a markup render item.
Comment #6
yeonik commentedI have updated the module according to your feedback.
Please check it again.
Comment #7
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.
Comment #8
yeonik commentedThank you for your support and guidance on the way.