Problem when referencing multiple content types

Created on 14 February 2025, 2 months ago

If the entity-reference field in the content type allows references to more than one other content type, the prompt sent to AI with have "Array" instead of the actual entity name.

In GetAISuggestions, there is this code:

      $possible_results = $this->getFieldAllowedValues($node, $field_name);
      $imploded_possible_results = implode('|', $possible_results);

When the field allows multiple content types, the $possible_results is a nested array rather that a simple array. For example:

$possible_results = [
  "article" = [
    1 = "article 1",
    2 = "article 2",
    ].
    "event" = [
    1 = "event 1",
    2 = "event 2",
    ]
  ]

which ends up with $imploded_possible_results being "Array|Array"

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mpotter

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024