Problem/Motivation
The following procedural functions need to move into OO code:
node_access_needs_rebuild
node_access_rebuild
_node_access_rebuild_batch_operation
_node_access_rebuild_batch_finished
We should create a new service for this for API around rebuilding node access.
Steps to reproduce
N/A
Proposed resolution
TBC call this NodeAccessRebuild with rebuild and needsRebuild methods.
Deprecate node_access_needs_rebuild and node_access_rebuild and call out to new service
Remove _node_access_rebuild_batch_operation and _node_access_rebuild_batch_finished as these are internal (prefixed with _)
Remaining tasks
Do it
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Comments
Comment #2
acbramley commentedComment #3
virag.jain commentedComment #5
acbramley commentedComment #6
virag.jain commentedComment #7
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. 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 #8
acbramley commentedComment #9
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. 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 #10
acbramley commentedComment #11
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. 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 #12
acbramley commentedComment #13
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. 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 #14
acbramley commentedComment #15
mstrelan commentedLeft some feedback
Comment #16
acbramley commentedFeedback addressed
Comment #17
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. 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 #18
acbramley commentedComment #19
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. 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 #20
acbramley commentedSquashed and rebased.
Comment #21
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. 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 #22
acbramley commentedComment #23
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. 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 #24
acbramley commentedComment #25
dcam commentedI found a couple of things and made comments on the MR. And the deprecation version strings need to be updated. And it needs to be rebased. So I'm setting this to Needs Work.
Comment #26
acbramley commentedFeedback addressed.
Comment #28
nicxvan commentedSorry to kick this back.
I think private properties have caused some serialization issues.
Also batch callbacks don't need to be static anymore so we can finish that conversion too.
Comment #29
acbramley commentedActioned feedback except the batch builder stuff
Comment #30
nicxvan commented#3575096: Remove callable type from BatchBuilder ::addOperation and ::setFinishCallback
Comment #31
acbramley commentedThis should be ready to go now
Comment #32
nicxvan commentedSorry to kick it back again, but the reason we were waiting was so the methods didn't need to be static and could use DI.
Comment #33
acbramley commentedComment #34
nicxvan commentedThank you! This looks great!
Comment #35
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. 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 #36
acbramley commentedComment #37
nicxvan commentedComment #38
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. 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 #39
acbramley commentedComment #41
alexpottCommitted 31e1980 and pushed to main. Thanks!
Comment #46
alexpottArghh... we did not remove all the references to node_access_rebuild() in docs. Reverted.
Comment #47
alexpottOkay I've re-opened the main branch and then fixed all the code comments mentioning the old methods. Also applied the same fixes to the 11.x MR.
Comment #48
alexpottThe commit to review for the comment changes is https://git.drupalcode.org/project/drupal/-/merge_requests/15620/diffs?c...
Comment #52
nicxvan commentedSorry about that!
I compared both MRs the only differences were the autowiring services and 11.x HelpHooks class didn't have a constructor yet on 11.x.
I pulled down the main branch and searched the four functions, the only remaining mentions are in the deprecated function docblocks.
I mistakenly thought
node_access_needs_rebuildwas referenced in the new service still, but @alexpott pointed out it's actually referencing the state key.I think this is ready now.
I also reviewed all of @alexpott's commits, injection for the form, the mentioned services change, comments and the backport, they all look good.
Comment #53
alexpottCommitted 3a0d690 and pushed to main. Thanks!
Committed 25e0b0b and pushed to 11.x. Thanks!
Comment #59
godotislateThe 11.x PHP 8.3 jobs (Postgres, mysqli, and sqlite) are failing, and it looks like it's an issue with the
$nodeAccessRebuildproperty inRebuildPermissionsFormbeing readonly: https://project.pages.drupalcode.org/-/drupal/-/jobs/9609293/artifacts/s...Basically, with DependencySerializationTrait, the service property is being re-initialized from the container in
__wakeup(), which is causing an error because it is readonly and can not be set outside the constructor.Not sure why this isn't affecting PHP 8.5, because I haven't found anything about fixing that readonly properties can be set in __wakeup(). We do have an open issue about this: #3424344: Allow DependencySerializationTrait to work with readonly properties, and #3548971: Replace PHP soft-deprecated __sleep()/__wakeup() with __serialize()/__unserialize() is somewhat related, because it seems readonly properties can be set in
__unserializeComment #62
godotislateActually, there are multiple tests failing because of separate issues, so opened #3588558: Test failures on 11.x.