- Issue created by @fathima.asmat
- Status changed to Needs review
about 1 year ago 9:44am 17 October 2023 - 🇮🇳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
- Status changed to Needs work
about 1 year ago 5:20pm 18 October 2023 - 🇮🇳India vishal.kadam Mumbai
FILE: src/Form/SettingsForm.php
$form['entity_types'] = [ '#type' => 'checkboxes', '#title' => 'Entity types', '#description' => $this->t('Select the entity types that should have a bulk action for assigning the content to a different author form the admin listings'), '#options' => $entity_types, '#default_value' => $selected_entity_types, ];
Form fields title must be translated strings.
- fathima.asmat London, UK
Ah, thanks @vishal.kadam - I have missed it from the title but added to description field. I have pushed the requested fix now, see https://git.drupalcode.org/project/author_bulk_assignment/-/commit/4a1f6...
- Status changed to Needs review
about 1 year ago 5:28pm 18 October 2023 - 🇮🇳India vishal.kadam Mumbai
Rest looks fine to me.
Let’s wait for other reviewers to take a look and if everything goes fine, you will get the role.
- fathima.asmat London, UK
Normally, does it take really long for the other reviewers to review and verify the application? Drupal Con Liile might have caused some delays :D
- Status changed to Needs work
about 1 year ago 2:38am 2 November 2023 - Status changed to Needs review
about 1 year ago 6:57am 2 November 2023 - 🇮🇳India vishal.kadam Mumbai
.gitignore files are allowed. There is no need to delete them.
- Status changed to Needs work
about 1 year ago 10:41am 2 November 2023 - 🇮🇳India yogita30
This warning message is not provide proper details for update entity permission to be required for the author.
- Status changed to Needs review
about 1 year ago 10:46am 2 November 2023 - 🇮🇳India vishal.kadam Mumbai
@YogitaR This is not an issue created in a project queue.
Comments in this queue are required to review the project files and report what needs to be changed. We do not debug projects.
- fathima.asmat London, UK
Thanks, Yogita, for the suggestion to clarify the warning message. As Vishal pointed out, this pertains to a security application issue for the project, and we should only use this for addressing security-related or breaking issues.
Since the reported issue is more of an improvement, it needs to be created as an issue in the project's issue queue. I've just done that for you and marked it as resolved in a new release. Feel free to review and provide feedback on that project's issue here: https://www.drupal.org/project/author_bulk_assignment/issues/3398675 🐛 Make the warning message clearer when the author assignment fails for entities inaccessible for the selected assignee Fixed . I've credited you for your contribution in checking the module and suggesting the improvement. 😊
Vishal, your continued feedback and advice are greatly appreciated! +1
- fathima.asmat London, UK
Could @apaderno or one of the core reviewers please kindly review this application and feedback? It is affecting our live deployment as our client is really pushing hard to get the security cover for this project before go live.
Many thanks in advance.
- 🇲🇩Moldova andrei.vesterli Chisinau
Hi @fathima.asmat
Thx a lot for your contribution to the Drupal community. A great respect from me. I did a smoke testing and a review of your module and here are some comments:
- The
composer.json
file looks a bit uncompleted. Here is how to configure it https://www.drupal.org/docs/develop/using-composer/add-a-composerjson-file → - Same for the
README.md
file. Here is an example on how to write it properly: https://www.drupal.org/docs/develop/managing-a-drupalorg-theme-module-or... → - As a recommendation, add the
hook_help
definition as this is a best practice for a new Drupal module development. - I see that you have the config/schema/* folder and this is awesome. What can I say is that you need the config/install/* folder too for the configuration from the
SettingsForm
class (as forauthor_bulk_assignment.settings
)
Again, great job!
- The
- Status changed to Needs work
about 1 year ago 9:13pm 7 November 2023 - fathima.asmat London, UK
Thanks andrei.vesterli for the feedback.
I have added the suggested improvements to README, composer.json files along with the hook_help to the module.
I haven't added a default install config for default settings as I don't want to keep the bulk option on for any entity type by default until the admin manually turns that option on after installation.
- Status changed to Needs review
about 1 year ago 10:34am 9 November 2023 - 🇲🇩Moldova andrei.vesterli Chisinau
Hi @fathima.asmat
Great! I have no comments here. This is OK from my side.
Regards,
Andrei - Status changed to Needs work
about 1 year ago 5:09pm 9 November 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
- What follows is a quick review of the project; it doesn't mean to be complete
- For each point, the review usually shows some lines that should be fixed (except in the case the point is about the full content of a file); it doesn't show all the lines that need to be changed for the same reason
- A review is about code that doesn't follow the coding standards, contains possible security issue, or doesn't correctly use the Drupal API; the single points aren't ordered, not even by importance
src/Form/SettingsForm.php
A form class that extends
ConfigFormBase
is for saving values in a configuration object. When the action done is different, the parent class must be different./** * The entity type manager service. * * @var \Drupal\Core\Entity\EntityTypeManagerInterface */ protected EntityTypeManagerInterface $entityTypeManager;
Since the module is declared compatible with any Drupal 9 version, it cannot use PHP 7.4 features, as only Drupal 9,4 dropped the support for PHP 7.3 or lower versions.
/** * {@inheritdoc} */ public function __construct(ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entityTypeManager, MessengerInterface $messenger) { parent::__construct($config_factory); $this->entityTypeManager = $entityTypeManager; $this->messenger = $messenger; }
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. It must also describe the accepted parameters.
$action = Action::create([ 'id' => $action_id, 'plugin' => 'entity:author_bulk_assignment_action:' . $definition->id(), 'label' => 'Assign bulk ' . strtolower($definition->getSingularLabel()) . ' to author', 'type' => $definition->id(), ]);
The label must be a translatable string, as any other strings shown to site users.
/** * {@inheritdoc} */ protected function isApplicableEntity(EntityTypeInterface $entity_type) { // Any entity type that has an author field. // Either "owner" OR "uid" field. return $entity_type->hasKey('uid') || $entity_type->hasKey('owner'); }
Since that is not a method defined from the parent class, its description comment cannot contain
{@inheritdoc}
.author_bulk_assignment.install
$actions_storage = \Drupal::entityTypeManager() ->getStorage('action'); $entity_types = \Drupal::entityTypeManager()->getDefinitions(); foreach ($entity_types as $entity_type) { if ($entity_type->hasKey('uid') || $entity_type->hasKey('owner')) { $actions = $actions_storage ->getQuery() ->condition('id', $entity_type->id() . '_author_bulk_assignment_action') ->execute(); if ($actions) { $action_entities = $actions_storage->loadMultiple($actions); foreach ($action_entities as $action_entity) { if ($action_entity instanceof Action) { $action_entity->delete(); } } } } }
For what I recall, Drupal core already uninstall the entities a module that is uninstalled defined. There is no need to implement that code.
author_bulk_assignment.libraries.yml
version: VERSION
VERSION
is only used by Drupal core modules. With contributed modules, that would increase the library version when there are no changes in the library itself. - fathima.asmat London, UK
Many thanks for your feedback, Apaderno. All your comments are addressed and the updates are pushed to 1.0.x branch.
- Status changed to Needs review
about 1 year ago 6:32pm 9 November 2023 - Assigned to apaderno
- 🇮🇹Italy apaderno Brescia, 🇮🇹
FormBase
has already a$messenger
property, which does not need to be redefined.setMessenger()
andgetMessenger()
should be used to initialize that property and to get the value stored in that property. - 🇮🇹Italy apaderno Brescia, 🇮🇹
Thank you for your contribution! I am going to update your account.
These are some recommended readings to help with excellent maintainership:
- Dries → ' post on Responsible maintainers
- Best practices for creating and maintaining projects →
- Maintaining a drupal.org project with Git →
- Commit messages - providing history and credit →
- Release naming conventions → .
- Helping maintainers in the issue queues →
You can find more contributors chatting on the Slack → #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 reviewers.
- Status changed to Fixed
about 1 year ago 7:06pm 9 November 2023 Automatically closed - issue fixed for 2 weeks with no activity.