A context entity can be filled with a reference entity (like 'node.uid.entity') when the action is created, but fails on update with this error message:

Expected a entity data type for context but got a entity_reference data type instead.

The reaction works well anyway. The attached video show the steps to reproduce. It fails in alpha3 as well as in the latest -dev from github.

Comments

manuel.adan created an issue. See original summary.

tree2009’s picture

@manuel.adan sorry, I can't play your avi video here, could you export the rule and paste it here to test, thanks.

tr’s picture

@drupalfan79: The link to the .avi file is still good and the video plays properly. If the problem is due to content-type restrictions in your country, is there something we can do to make this content available for you? The .avi file just shows the steps to take to reproduce this problem on a standard Drupal website.

tree2009’s picture

@TR, thanks for your help, and finally, I used another computer to play the video successfully.

I can reproduce the issue, and exported the rule here:

uuid: b11167d7-9878-448e-a283-051ba056f8d1
langcode: en
status: true
dependencies: {  }
id: test
label: test
events:
  -
    event_name: 'rules_entity_insert:node--article'
description: ''
tags: {  }
config_version: '3'
expression:
  id: rules_rule
  uuid: dc3bf78c-c3bb-4edf-83b4-e6a43e01979b
  weight: 0
  conditions:
    id: rules_and
    uuid: 6213da3f-14c8-4ea7-a156-c11853212566
    weight: 0
    conditions: {  }
  actions:
    id: rules_action_set
    uuid: 764c5192-60b6-4c29-887a-3a97cadd367b
    weight: 0
    actions:
      -
        id: rules_action
        uuid: 223cc553-ef6d-4aa0-a8e3-642c2dcbb431
        weight: 0
        context_values:
          immediate: ''
        context_mapping:
          entity: node.uid.entity
        context_processors:
          immediate:
            rules_tokens: {  }
        provides_mapping: {  }
        action_id: rules_entity_save

I believe it's about entity and entity_reference type comparison, and duplicated issue as #3059402 Set data action in referenced entity..

tr’s picture