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

Issue fork drupal-3533299

Command icon 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

acbramley created an issue. See original summary.

acbramley’s picture

virag.jain’s picture

Assigned: Unassigned » virag.jain

acbramley’s picture

Status: Active » Needs work
virag.jain’s picture

Status: Needs work » Needs review
needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The 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.

acbramley’s picture

Assigned: virag.jain » Unassigned
Status: Needs work » Needs review
needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The 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.

acbramley’s picture

Status: Needs work » Needs review
needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The 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.

acbramley’s picture

Status: Needs work » Needs review
needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The 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.

acbramley’s picture

Status: Needs work » Needs review
mstrelan’s picture

Status: Needs review » Needs work

Left some feedback

acbramley’s picture

Status: Needs work » Needs review

Feedback addressed

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The 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.

acbramley’s picture

Status: Needs work » Needs review
needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The 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.

acbramley’s picture

Status: Needs work » Needs review

Squashed and rebased.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The 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.

acbramley’s picture

Status: Needs work » Needs review
needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The 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.

acbramley’s picture

Status: Needs work » Needs review
dcam’s picture

Status: Needs review » Needs work

I 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.

acbramley’s picture

Status: Needs work » Needs review

Feedback addressed.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

nicxvan’s picture

Status: Needs review » Needs work

Sorry 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.

acbramley’s picture

Status: Needs work » Needs review

Actioned feedback except the batch builder stuff

acbramley’s picture

This should be ready to go now

nicxvan’s picture

Status: Needs review » Needs work

Sorry 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.

acbramley’s picture

Status: Needs work » Needs review
nicxvan’s picture

Status: Needs review » Reviewed & tested by the community

Thank you! This looks great!

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new91 bytes

The 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.

acbramley’s picture

Status: Needs work » Reviewed & tested by the community
nicxvan’s picture

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new91 bytes

The 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.

acbramley’s picture

Status: Needs work » Reviewed & tested by the community

alexpott made their first commit to this issue’s fork.

alexpott’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed 31e1980 and pushed to main. Thanks!

  • alexpott committed 31e1980b on main
    task: #3533299 Deprecate node access rebuild functions
    
    By: acbramley
    By...

  • alexpott committed b5d0936a on main
    Revert "task: #3533299 Deprecate node access rebuild functions"
    
    This...
alexpott’s picture

Version: 11.x-dev » main
Status: Patch (to be ported) » Needs work

Arghh... we did not remove all the references to node_access_rebuild() in docs. Reverted.

alexpott’s picture

Status: Needs work » Needs review

Okay 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.

alexpott’s picture

nicxvan’s picture

Status: Needs review » Reviewed & tested by the community

Sorry 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_rebuild was 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.

alexpott’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Fixed

Committed 3a0d690 and pushed to main. Thanks!
Committed 25e0b0b and pushed to 11.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • alexpott committed 25e0b0b5 on 11.x
    task: #3533299 Deprecate node access rebuild functions
    
    By: acbramley
    By...

  • alexpott committed 3a0d690d on main
    task: #3533299 Deprecate node access rebuild functions
    
    By: acbramley
    By...

godotislate’s picture

Status: Fixed » Needs work

The 11.x PHP 8.3 jobs (Postgres, mysqli, and sqlite) are failing, and it looks like it's an issue with the $nodeAccessRebuild property in RebuildPermissionsForm being 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 __unserialize

godotislate’s picture

Status: Needs work » Fixed

Actually, there are multiple tests failing because of separate issues, so opened #3588558: Test failures on 11.x.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.