Improve "Entity: Set field value" task/action form

Created on 3 June 2023, over 1 year ago
Updated 12 June 2024, 6 months ago

I think that the Custom properties form for this (and many other) tasks can be improved to make it more usable to new(er) users of the ECA module.

I consider myself a fairly seasoned Drupal developer, and I had (have) some confusion while learning to use this module. Some thoughts:

  1. Custom property: Field name: I would love to see this as a select list. Without some coding knowledge of Drupal entities, it is not obvious what value is expected here in many cases.
  2. Custom property: Field value: First, it is not completely obvious that this is the input value to this action. Granted, it can be inferred, but "obvious" would be better. Next, it is a bit counter-intuitive that other tasks can specify their output as a custom token by specifying the token name without the square brackets, but the full token name (including square brackets) is required here.
  3. Custom property: Entity: Again, a select list would be much better here. Like "Field name", some coding knowledge is probably necessary to get this on the first try.

I think that each of these thoughts can easily be applied to other tasks as well.

-mike

πŸ“Œ Task
Status

Active

Version

2.1

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States ultimike Florida, USA

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

Comments & Activities

  • Issue created by @ultimike
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    These are all valid points, thanks for discussing this. Unfortunately, most of it is difficult to provide due to missing context information during modelling.

    For example, in the "Set field value" action, the 2 fields "Entity" and "Field name" are related, as the field name needs to be one, that's available for the entity this action operates upon. However, while building the model, it is not always known what entities are available at the time of execution of that action. E.g. if working with an event "Insert content entity", there can be any entity type available to the action. And while the content type is unknown, the property panel cannot provide a drop-down list of available field names.

    So, for now, we only seem to be able to provide better field descriptions on how to find more information what to put into these configuration fields. However, there are plenty of issues in the issue queue for the roadmap to ECA 2.0, where we want to better support these settings forms with Drupal form API features like auto-complete. Once that's available, we may then be able to provide some more context-sensitive helpers to better support site builders to know what to fill in for these fields. However, there will always be limits, as ECA models can be so generic, that not enough context can be known while building them.

    When it comes to field values, it's mostly text (strings) that will be used there. And as part of such strings, tokens play a major role. There are read-only tokens provided by modules, all those can be found in the token browser. In addition to that, ECA models can create new tokens on the fly, they are only always available within the process where they get created. When creating such tokens in ECA, a name needs to be provided, and that's really "just a name", i.e. no brackets or other special syntax. Only when tokens are used as placeholders, i.e. when we expect the token to be replaced by its real value, it's where that [token-name] syntax comes in.

    The whole concept of tokens needs a comprehensive chapter in the ECA Guide and there is an issue just for that: https://gitlab.lakedrops.com/drupal/documentation/eca/-/issues/41

    There's also an issue to validating the input of the configuration forms to verify the token syntax where possible and provide feedback to the user when it's not as expected. For details, see ✨ Add token syntax validation where possible Fixed

    Having said all that, I don't want to turn down the idea of UX improvements. Just the contrary is the case, we really want to do what's possible, to make ECA easier for new users.

  • πŸ‡ΊπŸ‡ΈUnited States ultimike Florida, USA

    Thanks for the explanations - none of it is very surprising, I clearly understand the challenges in what I was asking about.

    I figure that others will have the same questions/challenges that I do/did, so I wanted to get it documented in here so that others looking for answers can at least get some context.

    -mike

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen
Production build 0.71.5 2024