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:

  1. (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.
  2. (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

  1. Decide on a solution
  2. Create PR for solution
  3. Update any documentation

User interface changes

Yes, depending on the solution chosen.

API changes

None.

Data model changes

None.

Command icon 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

recrit created an issue. See original summary.

scott_euser’s picture

Thanks for flagging! Can probably start with (1) given its a nice-to-have type feature provided by this module to keep it simple. Thanks!

scott_euser’s picture

Status: Active » Fixed

Added to merge train for route 1

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • scott_euser committed 035dab25 on 1.0.x
    fix: #3545490 Improve translation integration
    
    By: scott_euser
    

Status: Fixed » Closed (fixed)

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