- Issue created by @jbuttler
- 🇬🇧United Kingdom MrDaleSmith
Can you provide the prompt and automator settings you are using to generate the terms?
- Merge request !288Prevent PHP Notice by getting description from right place. → (Merged) created by MrDaleSmith
- 🇬🇧United Kingdom MrDaleSmith
mrdalesmith → changed the visibility of the branch 3489009-errors-when-successfully to hidden.
No problem! The category that is chosen always is correct based on the prompt input, and the category is always generated and applied to the reference field. If a term already exists, it chooses the existing term.
----------------------------------------------
Automator input mode: Base Mode
Automator Base Field: Prompt Field
Automator Prompt:
"
Based on the context text choose up to 1 category that fits the text. If no categories exist that fit the text, create 1 new category that applies to the context. Do not pass along any errors received. If there are already categories, do not try to assign any more. Never assign more than one category.
-----------------------
Context:
{{ raw_context }}
"- First commit to issue fork.
- 🇦🇹Austria roromedia Linz
I was running into the same issues, I had a brief look and I guess the problem was the following:
In
src/PluginBaseClasses/Taxonomy.php
in the methodgenerateTokens()
inline 116
there the implode()-function sets the parameter by default towithDescriptions = true
.
This throws an error afterwards inline 326
where$term->description->value
is used but the description of a term is empty.
I pushed a fix with a check if description is set, please review if this fixes the issue. - 🇬🇧United Kingdom MrDaleSmith
This already had a fix pending review, which has now been overwritten with code that recreates the original incorrect assumption in the code: at this point $term is NOT a taxonomy term so $term->description will never be set. Correct fix is in https://git.drupalcode.org/project/ai/-/merge_requests/288/diffs?commit_... - the string value always exists in the database, but is empty if no description provided.
- 🇩🇪Germany marcus_johansson
Paul, could you repush your changes, I don't see a way directly in Gitlab to revert it to that change. And then I'll merge.
- Merge request !345At this point term is not a loaded taxonomy term but data pulled directly from... → (Merged) created by MrDaleSmith