Problem/Motivation
AI Context (Context Control Center) 1.0.0-beta5 (tagged 6 September 2026) carries #3586405, which replaced the scope map field with a multi-value scope_id + value field. That is a BC break: the scope field no longer accepts a grouped array.
VarbaseAiFigmaInstaller::seedOwnContextItems() passes exactly that grouped shape (['global' => ['global']], from ai_figma.settings:context_scope) in two places, so seeding throws:
InvalidArgumentException: The scope field accepts only Field API deltas (scope_id + value). Use AiContextItem::setScope() for grouped arrays of scope_id => [value, ...].Two things make this worse than a red pipeline:
- It fails silently. The exception is caught and logged, so the recipe still reports that it applied successfully. The AI Context items are simply never created and nothing tells the site builder, beyond one watchdog line:
[warning] Could not seed the Varbase AI Figma context items: ... - The released code is affected, not just the branch. Varbase AI Figma 1.0.0 and Varbase AI Figma Base 1.0.0 both allow
drupal/ai_context: ^1.0, which permits beta5. The green CI run before beta5 existed only passed because beta5 was not yet published; re-resolving those released versions today reproduces the failure. This is not a regression introduced here. - Varbase AI Context's own test suite emits the same warning but does not assert on the seeded items, so it stays green while hiding the same breakage.
Steps to reproduce
- Install Varbase 11 (Drupal ~11.4) with PHP 8.3+.
composer require drupal/varbase_ai_figma_baseand let Composer resolvedrupal/ai_contextto 1.0.0-beta5.- Apply the Varbase AI Figma Base recipe.
- The recipe reports success. Go to the Context Control Center listing: none of the Varbase AI Figma context items are there.
drush watchdog:show --type=varbase_ai_figmashows the warning above.
Proposed resolution
- Stop writing the grouped array into the
scopefield. UseAiContextItem::setScope(), which takes the groupedscope_id => [value, ...]array on both 1.0.0-beta4 and 1.0.0-beta5, so the fix works either side of the BC break. - For the create path, drop
scopefrom the values passed tocreate()and set it on the entity before saving, sincecreate()goes through the same field setter that now rejects the grouped array. - Guard with
method_exists(), matching the existing style in the same method, so an older AI Context withoutsetScope()still works. - No constraint change: the code fix is backward compatible, so
drupal/ai_context: ^1.0stays as it is.
Varbase AI Figma Base carries no PHP of its own; it requires this module, so it needs no code change of its own. It will need a follow-up release once this fix is released, so that its dependency resolves to a working version. That follow-up is not filed here.
Remaining tasks
- ✅ File an issue
- ✅ Addition/Change/Update/Fix
- ❌ Testing to ensure no regression
- ➖ Automated unit testing coverage
- ➖ Automated functional testing coverage
- ➖ UX/UI designer responsibilities
- ➖ Readability
- ➖ Accessibility
- ➖ Performance
- ➖ Security
- ➖ Developer Documentation
- ➖ User Guide Documentation
- ❌ Reviewed by human
- ❌ Code review by maintainers
- ❌ Full testing and approval
- ❌ Credit contributors
- ❌ Review with the product owner
- ❌ Release notes snippet
- ❌ Release
User interface changes
- N/A
API changes
- N/A
Data model changes
- N/A
Release notes snippet
- Seeding the Varbase AI Figma AI Context items now works against AI Context 1.0.0-beta5, which no longer accepts a grouped scope array. Without this, the items were silently never created while the recipe still reported success.
Issue fork varbase_ai_figma-3621159
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 #3
rajab natshah