Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
\Drupal\user\Plugin\views\access\Role::access()
should return a Boolean but it returns an array. In access checking types can be combined and this might produce surprising results.
Discovered as part of #2742585: Deprecate dangerous assertTrue/False() compatibility overrides in PHPUnit Kernel, Functional and FunctionalJavascript tests
Proposed resolution
Change code to conform to \Drupal\views\Plugin\views\access\AccessPluginBase::access()
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
N/a
Comment | File | Size | Author |
---|---|---|---|
#2 | 3082287-2.patch | 1.55 KB | alexpott |
#2 | 3082287-2-test-only.patch | 943 bytes | alexpott |
Comments
Comment #2
alexpottComment #4
mondrakeDo we need a @todo to revert this to assertTrue and assertFalse in #2742585: Deprecate dangerous assertTrue/False() compatibility overrides in PHPUnit Kernel, Functional and FunctionalJavascript tests? Other than that, RTBC I'd say
Comment #5
alexpott@mondrake I don't think so. i think we need a follow-up to that issue to do a find and replace on all of the
$this->assertSame(FALSE,
and$this->assertSame(TRUE,
in core. Not worth doing in that issue imo just more noise.Comment #6
mondrakeOK then
Comment #7
mondrakeCritical as it is holding the Critical parent
Comment #8
Krzysztof DomańskiRTBC +1
Comment #9
Krzysztof DomańskiI created follow-up for #5: #3082415: Replace assert(Not)Same/Identical() on booleans with assert(Not)True/False() in PHPUnit tests.
Comment #11
larowlanCommitted 6f29f98 and pushed to 8.8.x. Thanks!
c/p to 8.7.x
Thanks folks