Problem/Motivation
This is only an issue I ran across while doing a PHPStan of a custom module at level 8. The media module has the same issue I ran across for my custom module.
MediaAccessControlHandler in the media module has this:
if ($account->hasPermission($this->entityType->getAdminPermission())) {
hasPermission is defined as only accepting a string, but getAdminPermission returns ?string.
Steps to reproduce
I haven't seen a crash or warning from this, but someone else saw an issue in a contrib module:
https://www.drupal.org/project/drupal/issues/3416110
Proposed resolution
I'm not entirely clear on where the change needs to be made, but I'll create an MR with one possibility.
Issue fork drupal-3587247
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
tolstoydotcomI can't change the MR, but my change is for line ~55 of MediaAccessControlHandler:
Comment #5
ishani patel commentedHello, @tolstoydotcom
I've raised MR Kindly review it.
Thank you!
Comment #6
tolstoydotcomLGTM, thanks.