Updated Content notification

Created on 26 April 2024, 8 months ago
Updated 15 August 2024, 4 months ago

Problem/Motivation

I would like to track what was changed on content. Lets image there are 10 fields in content type and once any of this field is updated I want to see message like "Field Ticket status has been updated from Open to Closed and Compete date was changed from Null to 25.4.2024"

I can use Update > Load entity (Load unchanged values) but I am struggling to find out what was changed so I can display it.

I know I can compare two values for specific field so I can determine if it was changed or not, but don't want to set condition for all fields so is there any better (global) way how to achieve the same with ECA?

Thank you

πŸ’¬ Support request
Status

Fixed

Version

1.1

Component

Documentation

Created by

πŸ‡ΈπŸ‡°Slovakia coaston

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @coaston
  • πŸ‡ΈπŸ‡°Slovakia coaston
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    ECA currently doesn't have an action like "Get a list of all properties/fields" which would be necessary to have a more generic approach to this. However, you could use Token: set value to define the list of properties and/or fields that you're interested in, and then build a loop over that list to compare each of those items one by one.

  • πŸ‡ΈπŸ‡°Slovakia coaston

    Thank you.

    I tried with your proposed solution and using multivalue loop but from some reason when i use multivalue field or views as list and try > grater than 0 it works fine...but when i use token set value with multiple fields separated by comma it does not work. So struggling.
    I have to debug.
    However not sure if I should create 2 tokens - one token with multiple fields which are origin and the second one with entity so i can compare values of 2 tokens but i gues i need to pop up the item using list remove(drop) item first in loop.

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    but when i use token set value with multiple fields separated by comma it does not work.

    You should define the list in yaml syntax and then enable that checkbox below to tell ECA that the content of that field should be interpreted as yaml, e.g.:

    - field_name_1
    - field_name_2
    - field_name_3
    
  • πŸ‡ΈπŸ‡°Slovakia coaston

    @jurgenhaas thank you.

    I am trying to combine also with this : User network changes demo, however once I import it I am getting following error when multivariate field does not have currently any value.

    Failed execution of Get field value: new networks (Activity_0g3f8fe) from ECA User network changes (eca_lib_0005) for event Drupal\eca_content\Event\ContentEntityUpdate: The provided field field_user_networks does not exist as a property path on the user entity having ID 1..
    

    It is just for the first value, when I tried to add additional one it works fine. Is that normal behavior ?

    I think it is because by default there is some value which is blank as shown here:

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Yes, that second issue is because that model was built under the assumption, that the field would have been there right from the beginning so that each user had a default value for the network, even if that's empty. Adding that afterwards leaves the existing users with no value, not even an empty one.

    That sample model is the result of a tutorial that has been provided by an ECA user. To improve on that model, maybe you could reach out to the author? The tutorial is linked from the ECA Guide library page that you linked to above.

    And the message you're seeing is helpful to tell you why a model isn't executing certain parts in a model. This is supposed to be helpful information, not an error.

  • Status changed to Postponed 8 months ago
  • πŸ‡ΈπŸ‡°Slovakia coaston

    Thank you.
    I am currently busy with other tasks but will reopen if needed later. However good to know i can ignore that warning.

  • Status changed to Postponed: needs info 7 months ago
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Thx

  • Status changed to Fixed 5 months ago
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024