- Issue created by @recrit
- Merge request !14Issue #3545171: Auto Apply does not support content moderation β (Merged) created by recrit
ISSUE 1 - Content Moderation:
When using the auto_apply_suggestions configuration, the batch AiReferenceBatch::batchFinished() loads the default revision in the default language with <code>Node::load(). This is incorrect when using content moderation and translations. With content moderation, the default revision may not be the latest revision when there is a published revision and a forward draft revision. In this case, the latest translation affected revision is used on the node edit forms.
ISSUE 2 - Translations:
This loading issue also exposes the fact that the "Generate references with AI" is attached to any node form, even translations. However, the taxonomy fields may not be translatable.
ISSUE 1 - Content Moderation:
Update:
$node = Node::load($results['nid']
To:
$node = \Drupal::service('entity.repository')->getActive('node', $results['nid']);
This will get the latest translated affected revision in the current content language.
ISSUE 2 - Translations:
Since this processes on node translation forms too, the value and form processing may need to be updated to handle which fields can be modified for the current translation.
Finalize solution.
None
None
None
Active
1.0
Code