Problem/Motivation
Discovered via #3581155: Investigate if shipmonk/dead-code-detector would be useful to us
Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait refers to $this->entityDefinitionUpdateManager but it is not declared in the trait.
It also refers to
$this->state</code, but it is not declared in the trait either.
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
Define <code>$entityDefinitionUpdateManager in the trait.
Also define $state in the trait.
Remove the property definition from all implementations of the trait.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|
Issue fork drupal-3581403
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
longwaveComment #4
longwaveThe trait also uses $state so let's declare that too.
Comment #5
smustgrave commentedMay be overkill but could we get a simple CR for this change?
Comment #6
longwaveYeah, just checked contrib and this might break a small number of tests, e.g. https://git.drupalcode.org/project/map_widget/-/blob/510e4352a80ce469832...
Comment #7
mstrelan commentedAdded a CR, add
$stateto the title.Comment #8
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. The merge request has merge conflicts and cannot be merged. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #9
mstrelan commentedBot took 10 mins to flick from NR to NW, that's speedy. I think I messed up the rebase anyway, so leaving NW as I'm out of time.
Comment #10
mstrelan commentedOK that's better now
Comment #11
smustgrave commentedCR reads well. Assuming this would be a 12 only? Or would it make it in 11.5?
Comment #12
godotislateI think there's one \Drupal::service usage in the trait that needs to be updated.
I also updated the IS.
Comment #13
godotislateThere is a type declaration added to $state in base class core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBase.php, so I think it'd be 12 only? Will confirm.
Comment #14
smustgrave commentedApplied the suggestion, will wait to put back in RTBC per #13 in case there's more.
Comment #15
smustgrave commentedReverted the change as it broke a bunch of tests.
Comment #16
godotislateOK, I assume there must have been a container rebuild involved somewhere.
Comment #17
smustgrave commentedPutting back in RTBC, unless work needs to be done for #13.
Comment #19
catchCommitted/pushed to main, thanks!
Lots of commit conflicts on 11.x, but I think we can just have this in main so moving to fixed.
Comment #21
quietone commentedPublished the change record