Problem/Motivation
Currently, this module generates AI reference suggestions on any node form. When using translations, the node form is used for the source language and the translations. The edit form's node object is rendered and used for the AI suggestions. This can lead to erroneous suggestions when on a translation. This is compounded by the fact that the most common configuration for taxonomy reference fields is to configure them as not translatable. So when suggestions are generated on the translation, it updates the term references on the source language's revision.
This module should not be updating the term fields when on a translation when the fields are not translatable.
Steps to reproduce
- Enable the "AI Auto-reference" module
- Enable Content Translation
- Configure a node type with a non-translatable taxonomy term reference field.
- Create a node in the source language, for example English.
- Edit the new node
- Generate AI suggestions for the node's source language translation
- Create a translation for the node, for example Spanish.
- Edit the translation (for example Spanish)
- Generate AI suggestions for the translation
- Select some suggestions and Apply them
- BUG: The source translation has been update since the term field is not translatable.
Proposed resolution
Options:
- (LOE: Easiest) Only provide the ability to generate AI suggestions for the default language translation (ie
$node->isDefaultTranslation(). For non-default translations, there would not be an option to generate AI suggestions to avoid any confusion. - (LOE: More Complex) Only provide the ability to generate AI suggestions when there are fields available for the node's language:
- On the default language translation, all fields would be available so the AI suggestions generation would be allowed.
- On a non-default language translation, only translatable fields would be available for suggestions. When there are no fields available, then the AI suggestions generation is not allowed.
Remaining tasks
- Decide on a solution
- Create PR for solution
- Update any documentation
User interface changes
Yes, depending on the solution chosen.
API changes
None.
Data model changes
None.
Issue fork ai_auto_reference-3545490
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
scott_euser commentedThanks for flagging! Can probably start with (1) given its a nice-to-have type feature provided by this module to keep it simple. Thanks!
Comment #4
scott_euser commentedAdded to merge train for route 1