2.0.x

Root Cause: AutomatorBaseAction::saveFormValues() calls $item->get('value') on image field items, but image fields don't have a value property (they have target_id, alt, title, width, height). This causes InvalidArgumentException: Property value is unknown.

Not Canvas-specific. Core ImageItem also lacks value. Canvas's ImageItemOverride inherits from ImageItem and doesn't change the property set. Compare with ImageAltText which works fine because it uses $formElementProperty = 'alt' — a valid image property.

Fix: Add a property existence check at the top of AutomatorBaseAction::saveFormValues():

$field_items = $entity->get($form_key);
$first_item = $field_items->first();
if ($first_item) {
  $property_definitions = $first_item->getFieldDefinition()
    ->getFieldStorageDefinition()
    ->getPropertyDefinitions();
  if (!isset($property_definitions[$this->formElementProperty])) {
    return $form[$form_key];
  }
}

The early return is correct here because LlmRewriteImageFilename::storeValues() already renames and saves the File entity directly — there's no field item property to read back.

Tested: Reproduced the exact error with Canvas + AI Automators on a Media Image form. After the fix, clicking "Automator Image Filename Rewrite" no longer crashes. All text-based field types (string, text, list_string, boolean, email, etc.) are unaffected — they have value in their property definitions and continue through the normal code path.

AI usage

  • AI Assisted Issue This issue was generated with AI assistance, but was reviewed and refined by the creator.
  • AI Assisted Code This code was mainly generated by a human, with AI auto-completing or parts AI generated, but under full human supervision.
  • AI Generated Code This code was mainly generated by an AI with human guidance, and reviewed, tested, and refined by a human.
  • Vibe Coded This code was generated by an AI and has only been functionally tested.

Merge request reports

Loading