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.
Rebuild permissions gives me :
Fatal error: Using $this when not in object context in /path/to/drupal8/core/modules/node/node.module on line 1296
This is caused by this oversight in _node_access_rebuild_batch_operation() :
$node_storage = $this->container->get('entity.manager')->getStorage('node');
Comment | File | Size | Author |
---|---|---|---|
#18 | d8-fatal-error-rebuilding-permission-2396519-18.patch | 4.22 KB | pcambra |
#18 | interdiff.txt | 3.2 KB | pcambra |
#12 | d8-fatal-error-rebuilding-permission-2396519-12.patch | 4.21 KB | pcambra |
#12 | interdiff.txt | 4.01 KB | pcambra |
#5 | d8-fatal-error-rebuilding-permission-2396519-5-combined.patch | 2.01 KB | willzyx |
Comments
Comment #1
willzyx CreditAttribution: willzyx commentedPatch attached
Comment #2
aspilicious CreditAttribution: aspilicious commentedI wanted to RTBC this but realised we don't have any tests for this...
Comment #3
willzyx CreditAttribution: willzyx commentedTest case attached
Comment #4
BerdirNice find, we also need a combined patch with the fix and the tests now.
Test looks correct, just a bunch of nitpicks...
Should be contains, with a leading \: \Drupal\node\...
Should only have one empty line.
Missing space before {
setUp() needs an @inheritdoc and the modules needs the usual Modules to enable @var array.
Isn't node already enabled by default in NodeTestBase?
No need to assign the user, you don't need it anymore later.
Comment #5
willzyx CreditAttribution: willzyx commented@Berdir
Coding standards issues were resolved. Thanks for reviewing
Combined patch with the fix and the tests is attached
Comment #8
dawehnerWow!
Certainly optional nitpick: You could use "Contains \Drupal\node ..."
What about adding a quick check that the rebuild was actually successfull? You could for example try the 'node.grant_storage' service ... to fetch entries.
Comment #10
dawehner.
Comment #11
willzyx CreditAttribution: willzyx commented@dawehner
1) There are ~35 test cases that use "Definition of Drupal\node\.." ( without a leading \ ) in the node module.. what is the way to follow?
2) I'm not sure what you mean.. Aren't we verifing that node access rebuild functions work correctly even when other modules implements hook_node_grants()? isn't better to delegate to a separate test case the check that rebuild (according to the assignment of the grants defined in node_test_access) was actually successfull?
Comment #12
pcambraNew patch taking into account #8, added a few tests using the grant storage service
Comment #13
dawehnerContains is kind of the standard since 2 years, but we just had a hard time updating the old one :)
nice tests!
Comment #14
amateescu CreditAttribution: amateescu commentedI found two small nitpicks, sorry :/
Any reason to not use camel case here? :)
These two need the member visibility (public).
Comment #15
alexpottFor #14
Comment #16
alexpottFixing the title to be a bit more specific.
Comment #17
alexpottThis actually must be a critical because if this does not work then there are possible security implications.
Comment #18
pcambraThanks for the review @amateescu, here's a new patch fixing #14
Comment #19
dawehnerFeedback got addressed
Comment #20
amateescu CreditAttribution: amateescu commentedYup :)
Comment #21
alexpottThis issue addresses a critical bug and is allowed per https://www.drupal.org/core/beta-changes. Committed 33eb65a and pushed to 8.0.x. Thanks!