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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | permissions_by_term-fix-batch-updating-3251027-4.patch | 654 bytes | baluertl |
| #2 | permissions_by_term-fix-batch-updating-3251027-2.patch | 478 bytes | mikkmiggur |
Issue fork permissions_by_term-3251027
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
Comment #2
mikkmiggur commentedRemoving line:
batch_process(\Drupal::service('path.current')->getPath());from the src/Services/NodeAccess.php file seems to fix that issue.
Comment #3
baluertlComment #4
baluertlRe-roll patch for the latest D9-supported version of this module
3.1.34.Comment #8
vitaliyb98 commentedAdded merge request with changes, I confirm that
batch_process($this->currentPath->getPath());"is redundant.See comments from 'batch_process'
Comment #9
vitaliyb98 commented@jepster_ could you please review this solution?
Comment #10
vitaliyb98 commentedProvided 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.
Comment #11
vitaliyb98 commentedCommitted and pushed to 3.1.x-dev Thanks!