Problem/Motivation
Follow-up from #3279840: Update mglaman/phpstan-drupal.
In there we found that the rule for access check-checking on entity queries (introduced in mglaman/phpstan-drupal version 1.1.15) isn't fully working yet.
Since we wanted all the "goodness" that a jump from the at the time version 1.1.9 to 1.1.16 would bring, we decided to update to 1.1.16, _but_ ignoring the rule for that.
An entry in core/phpstan.neon.dist was made for ignoring this rule:
# This check was ignored on purpose until the issues with it, which started in version 1.1.15, are solved.
# @see https://www.drupal.org/node/3280328
- "#^Missing explicit access check on entity query.#"
Steps to reproduce
Proposed resolution
As soon as mglaman/phpstan-drupal cuts a release that solves all our issues with the above rule, remove the above lines from core/phpstan.neon.dist.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comments
Comment #2
spokjeComment #3
spokjePostponing on a release of
mglaman/phpstan-drupalwhich solves all our issues with the access check-checking on entity queries.Comment #4
spokjeLooks like with the release of https://github.com/mglaman/phpstan-drupal/releases/tag/1.1.24 the problems are gone.
Comment #5
spokjeComment #6
spokjeComment #7
spokjeComment #8
spokjeComment #9
anchal_gupta commentedI have fixed CS error. Please review it
Comment #10
spokje@Anchal_gupta: Posting a patch on an issue that is assigned to somebody can be considered impolite by some people.
I am one of those people.
Please make sure the issue is either not assigned or of it is, make sure the issue has been stale for quite a while before posting a patch.
Also, the code changes don't make any sense.
More importantly: the patch doesn't pass. That in itself can happen, look at my own attempts in this issue.
However when I look at your recent posts, I see a lot of those CFF patches, which you never seem to follow-up with a fixed patch.
IMHO that's counterproductive to get an issue committed.
Please check if a patch passes, if not, don't walk away, but try to fix it in a follow-up patch.
Comment #11
spokjeComment #12
spokjeComment #13
mondrakeCan we have a test-only patch, without the removal of the ignored pattern, to proof we do not have any lagger?
Comment #14
spokjeUnsure what this will proof, but here you go
Comment #15
spokjeOK, now I see what can be proven... :)
Comment #16
mondrakeThat proves that removing the ignore, there are no more errors like that reported. Thanks!
Patch in #10 is the one for commit.
Comment #17
alexpottThis is incorrect. This should be accessCheck(FALSE) - see \Drupal\migrate_drupal\Plugin\migrate\source\ContentEntity::query()
These changes don't look great to me. They look like there are still problems with the rule.
Comment #18
alexpottThis also looks suspiciously like the rule is not correctly implemented. This change should not be necessary.
Comment #19
spokjeComment #20
spokjeFixed with #3330305: Fix failing "updated deps" test-runs by upping mglaman/phpstan-drupal to latest