Using 8.x-3.x-dev and 8.x-3.0-alpha2 . I cannot get a rule to fire on "After updating content" .

Rule will fire fine on "After saving new content" in both versions.

Any ideas?

Comments

sonoutlaw created an issue. See original summary.

sonoutlaw’s picture

Couldn't figure it out, so I wrote a custom module to address my clients needs.

I really appreciate the hard work by the team to get Rules out the door. Just my OOP skills aren't at the level where I can be of much assistance to the project.

lissy’s picture

I have the same Issue:
fresh installation of Drupal 8.3 + rules 8.x-3.0-alpha2

Rule will fire fine on "After saving new content" but not on "After updating content".

And I get an error:
Warning: preg_match_all() expects parameter 2 to be string, array given in Drupal\typed_data\PlaceholderResolver->scan() (line 186 of modules/typed_data/src/PlaceholderResolver.php).

jonathan1055’s picture

tr’s picture

Status: Active » Closed (cannot reproduce)

I cannot reproduce this - it works correctly at this time with the current -dev release of Rules. Here is the export of my test rule. I used the "After updating content" event with an action to show a system message. I tested it by updating nodes of several content types, and in each case the system message was shown as expected.

If you are still having this problem with the current -dev version of Rules, then please create a simple reaction rule like I have done and export it to show what exactly you are doing that doesn't work.

uuid: 1c6accc2-1e9f-45f3-bae3-308ceff75ae0
langcode: en
status: true
dependencies: {  }
id: test_rule_for_issue_2864533
label: 'Test rule for issue 2864533'
events:
  -
    event_name: 'rules_entity_update:node'
description: ''
tags:
  - ''
config_version: '3'
expression:
  id: rules_rule
  uuid: 3b313235-21fd-40b8-bc31-dd0d1b1cb7cb
  conditions:
    id: rules_and
    uuid: ceb0b17d-d8b8-4e00-9d90-fc5734b5a62d
    conditions: {  }
  actions:
    id: rules_action_set
    uuid: dfa202c4-f152-40ae-adb0-6bb1a4eda25b
    actions:
      -
        id: rules_action
        uuid: d150ab67-35f8-49c3-8e3b-04707186e56f
        context_values:
          message: '<b>Content updated:</b> {{ node.title }}'
          type: status
          repeat: false
        context_mapping: {  }
        context_processors:
          message:
            rules_tokens: {  }
          type:
            rules_tokens: {  }
          repeat:
            rules_tokens: {  }
        provides_mapping: {  }
        action_id: rules_system_message