Problem/Motivation

Noticed while working on a specific translator that had no settings during submit but they were set in the form.

Somehow, when getJob() is called during formProcessing() and then the same job item is submitted and getJob() is called again, it didn't have settings.

Proposed resolution

Always load the job from the storage, in case it was saved and the static cache was resetted. So change $this->get('tjid')->entity to Job::load($this->get('tjid')->target_id)

Technically this is a core issue but will be very hard to fix generically.

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir created an issue. See original summary.

ritzz’s picture

Assigned: Unassigned » ritzz

Working on it.

ritzz’s picture

Status: Active » Needs review
FileSize
2.9 KB

Kindly review.

Berdir’s picture

Status: Needs review » Fixed

Thanks. Thought about a test for it but quite tricky to test.

  • Berdir committed a7d5bf1 on 8.x-1.x authored by ritzz
    Issue #2940365 by ritzz: JobItem::getJob() can return stale job during...
Berdir’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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