Problem/Motivation

\Drupal\entity_usage\Form\BatchUpdateForm::submitForm() attempts to create a batch operation for every single available entity. For large sites, the submit form takes too long to build these operations resulting in a timeout.

Proposed resolution

Reduce the time needed to generate batches in BatchUpdateForm::submitForm() so it can be used on large sites.

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

The time needed to generate batches in BatchUpdateForm::submitForm() is reduced, so it no longer generates a timeout on large sites.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

idebr created an issue. See original summary.

idebr’s picture

Status: Active » Needs review
FileSize
11.19 KB

Attached patch implements the following changes to BatchUpdateForm:

  1. Create batch operations per entity type.
  2. Existing entity usage statistics are deleted for the entity type on its first batch call.
  3. Each batch operation is called again until all its entities have been tracked, using a limit of 10 entities per batch.
  4. Fixed a small number of coding standards violations as reported by phpcs.
  5. Updated wording of the entity type labels, the submit button, and the batch progress messages.

Status: Needs review » Needs work
idebr’s picture

Status: Needs work » Needs review
FileSize
1017 bytes
11.75 KB

Updated JavaScript test with the new text selectors.

  • marcoscano committed 3c00d0a on 8.x-1.x authored by idebr
    Issue #2936193 by idebr: "Batch Update" form generates a timeout when...
marcoscano’s picture

Status: Needs review » Fixed

Fixed, thanks!

Status: Fixed » Closed (fixed)

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