Problem/Motivation

After setting permissions to the term, batch updating doesn't start. It ends with nginx timeout.

Steps to reproduce

Having a site with about ~10 000 nodes. After changing term permissions and allowed roles, clicking save should start batch updating to the nodes but after some loading, I got a timeout from nginx.

Proposed resolution

Seems like
batch_process(\Drupal::service('path.current')->getPath());
is redundant in the src/Services/NodeAccess.php file.

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

mikkmiggur created an issue. See original summary.

mikkmiggur’s picture

Removing line:
batch_process(\Drupal::service('path.current')->getPath());
from the src/Services/NodeAccess.php file seems to fix that issue.

baluertl’s picture

Title: After setting permissions to the term, batch updating doesn't start. » After setting permissions to the term, batch updating doesn't start
baluertl’s picture

Re-roll patch for the latest D9-supported version of this module 3.1.34.

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

vitaliyb98 changed the visibility of the branch 3251027-batch-not-started to hidden.

vitaliyb98’s picture

Added merge request with changes, I confirm that batch_process($this->currentPath->getPath());" is redundant.
See comments from 'batch_process'

"This function is generally not needed in form submit handlers; Form API takes care of batches that were set during form submission."

vitaliyb98’s picture

Status: Active » Needs review

@jepster_ could you please review this solution?

vitaliyb98’s picture

Provided a functional test for this functionality.

Note: Node access batch rebuild is triggered only if Disable node access records is disabled and the term has more than 50 nodes.

This functionality exists on the user edit and term edit forms.

Steps (on term edit form):
1. Create a taxonomy term.
2. Create more than 50 nodes with this term
3. Enable "Show term selection in the user form" and ensure that this checkbox is UNCHECKED "Disable node access records" on this page: /admin/permissions-by-term/settings
4. Open the edit term page, and set some role in the permission section

After submitting the edit term form, the batch process should start.

In case with user edit form, only Step 4 will be different.

vitaliyb98’s picture

Status: Needs review » Fixed

Committed and pushed to 3.1.x-dev Thanks!

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

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

Maintainers, please credit people who helped resolve this issue.

  • vitaliyb98 committed 7a91244b on 3.1.x-dev
    Issue #3251027 : After setting permissions to the term, batch updating...

Status: Fixed » Closed (fixed)

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