- Issue created by @MrDaleSmith
- Merge request !425Add settings to allow the user to choose which entities the module is used on,... → (Open) created by MrDaleSmith
- 🇬🇧United Kingdom MrDaleSmith
I decided we'd be best off not trying to automate this because the existing form alter includes string field types and the majority of content entities have at least one string field: filtering out all the ones we assume it won't make sense to use the AI on would add a lot of conditionals and mean we might block users from doing something they want to do.
Instead I've added a settings form to let users decide for themselves, and an update hook that sets the settings to preserve the previous behaviour for anyone who was already using the module.
- 🇧🇪Belgium wouters_f Leuven
Tested this:
Gave me this error:
NOTICE: PHP message: Uncaught PHP Exception AssertionError: "Failed to assert that "ai_content_suggestions_plugins, ai_providers, entity_types, user.roles:authenticated" are valid cache contexts." at /var/www/html/web/core/lib/Drupal/Core/Cache/Cache.php line 31
If i removed the line$form['#cache']['contexts'][] = 'entity_types';
From the Settings form, it worked as expected.
- 🇧🇪Belgium wouters_f Leuven
(there is also a merge conflict which might prevent it from getting merged. might be best to resolve that too).
- 🇬🇧United Kingdom MrDaleSmith
That error comes if you don't clear caches after adding the new ca he context: can you confirm if you did that?