Closed (fixed)
Project:
Drupal core
Version:
9.4.x-dev
Component:
dblog.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Oct 2021 at 17:57 UTC
Updated:
13 Jan 2022 at 22:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
avpadernoComment #3
avpadernoComment #4
avpadernoComment #5
dagmar@apaderno thanks for the patch. I think we should also change the users of
$this->formBuilderand$this->moduleHandlerto the more robust method provided by the parent class formBuilder() and moduleHandler()Comment #6
vicheldt commentedI'll find and change what @dagmar mentioned.
Comment #7
avpadernoThe parent class only has getter methods, for example
formBuilder().Since
$this->formBuilderis already initialized from the class constructor, using that method doesn't make the code more robust.I will provide a patch that uses
$this->formBuilder()and$this->moduleHandler(), but I think it's the first patch that should be committed.Comment #8
avpadernoComment #9
vicheldt commentedI just talked to someone about this and the first patch looked fine, if anyone else wants to check this to make sure it's fine, it'd be best.
Comment #10
dagmarThanks for the patches. I think both patches work as @vicheldt and @apaderno. I traced back on the change records when formBuilder and
moduleHandler() were introduced. And they were set to reduce boilerplate. So in theory we should try to reduce the code of the constructor and use the existing methods. I also counted how many instances of
formBuilder()vsformBuilder->are in core. And there is a clear winner ofusing
formBuilder()I will left the decision of what to commit to core maintainers.
@vicheldt thanks for your contribution as well!. you are welcome to take a look to other Novice issues that I tagged in the past.
Comment #13
avpadernoThe error reported in the test result isn't caused by this patch. I am changing status back, and adding tests for Drupal 9.4.x.
Comment #14
alexpottCommitted and pushed 9629d09d405 to 10.0.x and 8417e5ff439 to 9.4.x. Thanks!