Both hook_entity_insert() and hook_entity_update() call tmgmt_content_create_continuous_job_items(). This is a potentially expensive call.

ContentEntitySource->getItemTypes() seems to indicate that any entity type with entity_revision_parent_type_field set would not be an eligible source (e.g. Paragraphs). However, there is nothing in the entity insert/update hooks to prevent creating continuous job items for those entities.

It seems like the hooks should respect allow content source entities and not attempt to create continous job items for them.

Will attach patch. My thinking/approach may be naive, so I'd appreciate feedback.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

timcosgrove created an issue. See original summary.

timcosgrove’s picture

Patch attached. This just checks the entity type for entity_revision_parent_type_field and passes if it's found. This approach may be naive.

Berdir’s picture

Status: Active » Needs review

Don't forget to set issues to needs review when uploading a patch.

Status: Needs review » Needs work
timcosgrove’s picture

Status: Needs work » Needs review

Moving this back to needs review, as the tests pass now.

Again, the motivation here is to not call tmgmt_content_create_continuous_job_items() on entities that are not eligible for translation.

  • Berdir committed 0f12676 on 8.x-1.x authored by timcosgrove
    Issue #2863486 by timcosgrove: tmgmt_content_entity_insert() and...
Berdir’s picture

Status: Needs review » Fixed

Makes sense, committed.

Status: Fixed » Closed (fixed)

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