Rearrange ECA token creation

Created on 5 July 2023, over 1 year ago
Updated 15 December 2023, about 1 year ago

Problem/Motivation

We create a [push_notification] token by creating a DTO. Here we add the values recipient (user entity) and the entity itself.

If we want to access the token [push_notification:recipient:last-login] by the replace method of the TokenService, we get an empty string. We also cannot access the values of the entity.

Proposed resolution

We move the recipient and the entity out of the DTO and create new tokens, [push_notification_recipient] and [push_notification_entity]. Now we can access the values, e.g. [push_notification_recipient:last-login].

📌 Task
Status

Closed: works as designed

Version

2.2

Component

Code

Created by

🇩🇪Germany danielspeicher Steisslingen

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

Comments & Activities

  • Issue created by @danielspeicher
  • @danielspeicher opened merge request.
  • Status changed to Needs review over 1 year ago
  • Issue was unassigned.
  • 🇩🇪Germany jurgenhaas Gottmadingen

    The code is looking good. I'm just worried about the breaking change for the installed sites. Is there a simple test scenario with which we can easily debug the old and the new structure. Maybe we can still find out why the previous approach didn't work?

  • Status changed to Needs work over 1 year ago
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Seems like I forgot to update the status when writing my previous comment.

  • Assigned to danielspeicher
  • 🇩🇪Germany jurgenhaas Gottmadingen

    @danielspeicher any chance we can address this now for Drupal 10? The MR doesn't apply any longer, but also the question from #5 is probably worth getting back into.

  • Status changed to Closed: works as designed about 1 year ago
  • 🇩🇪Germany danielspeicher Steisslingen

    The fact, that replace behaves differently as getOrReplace is intended.

    The corresponding ECA model is changed. The required token is set in an action, which uses getOrReplace and the entity or user can be accessed.

Production build 0.71.5 2024