ECA 2 is a major milestone. The main improvements are:

  • Minimum requirements: Drupal 10.3 and PHP 8.1
  • Code cleanup and refactoring, all linters are green for the complete codebase
  • Removed usage of all deprecations, PHPStan is all green on level 6
  • Dynamic event subscriber: while ECA 1 subscribed to all 233 events (84 from provided by ECA, 149 by other modules), ECA 2 now only subscribes to those events, that are relevant on each Drupal site. This comes together with a huge simplification when adding new event plugins, details to be found in the API changes for ECA event plugins change record.
  • 74 new plugins, 13 events, 2 conditions, 59 actions
  • 164 issues have been resolved (details below): 40 new features, 58 tasks, 58 bugs, 8 miscellaneous
  • Dynamic tokens provided by events are now exposed to the UI and in the ECA Guide
  • Significant and breaking changes are documented in the Change records for ECA

Important for developers: Please review the change records carefully, since they contain important information on how to update modules that integrate with ECA. This is especially important for ECA event plugins, and if action plugins have been implemented by extending \Drupal\eca\Plugin\Action\ActionBase, then the $tokenServices needs to be renamed into $tokenService.

How to upgrade and test

When coming from ECA 1, you should first update to Drupal 10.3. Afterwards, you can update ECA and all other modules that integrate with ECA to version 2 (and equivalent for other modules). Then, some maintenance tasks are recommended:

  • Create a database backup
  • Clear cache with drush cr
  • Update database with drush updatedb
  • Update existing ECA models with drush eca:update

Feedback is important to us. Please provide your findings in the issue queue or in the #ECA channel of Drupal Slack.

Contributors (45)

Atropoides, ConradFlashback, Grimreaper, NicholasS, PCate, PhilY, SirClickalot, _pratik_, a.sinitsa, abx, boromino, bradjones1, danielspeicher, dgb-2000, djdevin, ergonlogic, eswiderski, freelock, gjonc, gombi, heliogabal, joelseguin, johnpicozzi, josh.fabean, jrochate, jurgenhaas, jvogt, k.prozorov, kevinquillen, klausi, kopeboy, kushagra.goyal, lexsoft, lostcarpark, luiss-r, mxh, qichanghai, ressa, rkoller, robotjox, rocketeerbkw, sgroundwater, tobiasb, ultimike, wye79

Changelog

Issues: 164 issues resolved.

Changes since 1.1.x:

Feature

  • #3277468 by jurgenhaas, mxh: Performance optimization: dynamic event subscription
  • #3307337 by jurgenhaas, johnpicozzi, mxh: Tag form fields that support tokens
  • #3324972 by jurgenhaas, mxh, a.sinitsa, danielspeicher: Simplify the creation of new user accounts
  • #3327075 by mxh, jurgenhaas: Language handling
  • #3330979 by jurgenhaas, danielspeicher: New actions to access key value stores
  • #3331065 by mxh, ConradFlashback, jurgenhaas: List: remove item with drop with specified value" method
  • #3332859 by jurgenhaas: Add data provider for response events
  • #3333644 by jurgenhaas, eswiderski, danielspeicher, mxh: Extend cache actions beyond ECA
  • #3343942 by tobiasb, jurgenhaas, mxh: Return also the current language for type url
  • #3344964 by Atropoides, jurgenhaas: Extend new user action functionality to set status
  • #3345206 by Atropoides, jurgenhaas: Make token pass the validation of email field in action NewUser
  • #3347155 by mxh, jurgenhaas: eca_base: Provide a mechanic to recursively replace tokens
  • #3347915 by lexsoft, jurgenhaas: eca_content - "Entity: load via reference" action - tokens on field ref
  • #3352393 by danielspeicher, jurgenhaas, mxh: New condition: Contains for lists
  • #3352901 by danielspeicher, jurgenhaas, freelock: New action/condition: entity diff
  • #3355482: Add a seach input filter to ECA's admin list
  • #3357267 by jurgenhaas, danielspeicher, mxh: Add token syntax validation where possible
  • #3360229 by mxh, jurgenhaas: Provide some actions for getting available options and default values
  • #3363010 by jurgenhaas, josh.fabean, a.sinitsa: Add optional View Mode condition to "View Content Entity" Event
  • #3363022 by mxh, jurgenhaas: eca_form: Find a better integration for Paragraphs and Inline Entity Form
  • #3368530 by jurgenhaas: eca_log: LogMessageEvent should provide tokens with log message details
  • #3372220 by mxh: eca_config: Provide original data as token
  • #3375014 by danielspeicher, jurgenhaas, a.sinitsa: Persistent state read/write token support in State name
  • #3376172 by PCate, jurgenhaas: Provide relevant tokens to migrate events
  • #3376561 by jurgenhaas, klausi, danielspeicher: Add action plugin to temporarily change the ECA log level
  • #3381021 by Grimreaper, jurgenhaas: Being able to rename physical file
  • #3407071 by jurgenhaas, kevinquillen: New action: save file from string data
  • #3413762 by jurgenhaas, jrochate: Set Entity View Mode
  • #3415275 by jurgenhaas: ECA Endpoint: Add support for Ajax requests
  • #3415530 by jurgenhaas: ECA Render: new action to add a class to a render array
  • #3419478 by jurgenhaas: ECA Render: add event for entity view
  • #3419482 by jurgenhaas: ECA Misc: provide more tokens for request and response events
  • #3419516 by jurgenhaas: ECA Endpoint: allow action plugins on any request and response
  • #3421088 by k.prozorov, jurgenhaas: Allow tokens in "Entity: create new" for langcode
  • #3422936 by jurgenhaas, lostcarpark: Add "Use token" option to drop-down lists
  • #3435934 by jurgenhaas: Add support for views events and actions
  • #3435946: Add token support for filenames in Views Export action
  • #3441450: Let ECA models provide tokens by implementing hook_token_info
  • #3448090 by jurgenhaas: Export model as recipe
  • #3449727 by jurgenhaas: Add support for select fields with multiple set to true

Task

  • #3300596 by danielspeicher, jurgenhaas: Write plugin and field documentation for modules Form and Log
  • #3306180 by jurgenhaas, rkoller, mxh: System status report page indicates an ECA token type does not have a token defined
  • #3306556 by jurgenhaas: ECA action plugin need the ECA logger service
  • #3325190 by _pratik_, jurgenhaas: Make token names consistent
  • #3325836 by jurgenhaas: Add installation instructions to each module when exporting plugins to ECA Guide
  • #3327133: Write plugin field documentation for module miscellaneous
  • #3331337 by jurgenhaas, mxh, danielspeicher: Code cleanup from PHPStan report
  • #3331919 by jurgenhaas, boromino: Catch Throwable instead of Exception will also catch NULL issues
  • #3333115 by jurgenhaas, rocketeerbkw: Unable to fix an existing model after an action plugin rename
  • #3334759 by jurgenhaas: Review usage of ctype_digit in the code base
  • #3335353 by jurgenhaas, robotjox, abx, danielspeicher: Debugging cron event
  • #3337182 by jurgenhaas: Make all model exportable
  • #3337575 by jurgenhaas: Form validation for eca_tamper plugin needs to be re-enabled
  • #3338015 by jurgenhaas, rocketeerbkw, rkoller: Proposal: Versioning of libraries on ecaguide.org
  • #3339571 by jurgenhaas, danielspeicher: Set PHP 8.1 as minimum requirement
  • #3340257 by danielspeicher: Document plugin fields of module user
  • #3340487 by mxh, jurgenhaas: Clean-up usage of $this->tokenService vs. $this->tokenServices
  • #3340487: Clean-up usage of $this->tokenService vs. $this->tokenServices
  • #3344682 by jurgenhaas, danielspeicher: Turn 1.2 branch into 2.0.x
  • #3345929 by mxh, abx, jurgenhaas: Let "Token: set value" use new objects when referring to existing ones
  • #3347936 by PCate, jurgenhaas: Missing watchdog log type for ECA Log view
  • #3348422 by jurgenhaas, mxh: Make all token data providers discoverable and expose them in the UI and in the ECA Guide
  • #3348429 by mxh, jurgenhaas: eca_form: Impossible or hard to identify an inline entity form
  • #3351738 by jurgenhaas, abx: "Entity : Load" with multivalue entities OR condition "Not Current Node"
  • #3352864: Define required constraint for BPMN based modellers
  • #3354381 by jurgenhaas, mxh: Exclude the user entity type from "Entity: create new"?
  • #3357558 by jurgenhaas, abx: ECA Views Error with Argument can't be longer than 128 characters
  • #3364310 by jurgenhaas, ultimike, ressa: Idea for project page to help with on-boarding
  • #3369889 by mxh: eca_form: Improve compatibility with other form-altering modules such as field_group
  • #3372296 by mxh, jurgenhaas, luiss-r: How to disable single checkbox and set default values in multi-value checkboxes form element?
  • #3373537 by jurgenhaas, mxh, kushagra.goyal, dgb-2000, danielspeicher: String token values get returned as markup casted back to string
  • #3375167: PHPStand level 6 fixes
  • #3376304 by jurgenhaas: Enhance (or add) access control in plugins where required config fields support tokens
  • #3380771 by jurgenhaas, mxh: Cleanup usage of Event classes
  • #3381551: Performance optimization: Unify the event and process initialization layer
  • #3382070 by jurgenhaas, mxh: Enable event plugins to determine appliance
  • #3382965 by Grimreaper, jurgenhaas: Problem detected in documentation examples
  • #3383312 by jurgenhaas: Annotate ECA plugins with version when they got introduced
  • #3384786 by jurgenhaas: Update plugin templates for code generator
  • #3389309 by jurgenhaas, kopeboy, danielspeicher: ECA Endpoint not found without second path argument
  • #3408399: Cleanup creators to properly handle static types
  • #3412082 by jurgenhaas: Move ECA webprofiler integration into its own module
  • #3413808: Remove PHPStan ignore error code when better solution is available
  • #3421577 by kopeboy, jurgenhaas: ECA Render: Calling get_class() without arguments is deprecated
  • #3423162 by danielspeicher: Restructure tests in render module
  • #3423616 by jurgenhaas: Move BEFORE_INITIAL_EXECUTION and AFTER_INITIAL_EXECUTION from subscribers to ECA events
  • #3423862 by jurgenhaas: Remove deprecated getContentType method calls
  • #3424054 by jurgenhaas: Merge all EcaEvents::BEFORE_INITIAL_EXECUTION into one class/method
  • #3424119 by jurgenhaas: Clarify execution of \Drupal\eca_form\Token\CurrentFormDataProvider::getData
  • #3427036: Replace deprecated method renderPlain
  • #3427038: Replace deprecated method getName
  • #3427051 by jurgenhaas: Handle CSPELL feedback
  • #3430031: Automated Drupal 11 compatibility fixes for eca
  • #3437321: Add support for cache collector for state in core
  • #3437330: Replace usage of deprecated class Drupal\Core\Render\Element\RenderElement
  • #3441884: ECA Render: how to prevent output of render action when token name defined for later use
  • #3446327 by jurgenhaas: Provide ECA recipes
  • #3449732 by jurgenhaas: Further improve error handling when collecting plugins
  • #3449735 by jurgenhaas: Provide post update helper function to rename tokens

Bug

  • #3331810 by mxh, jurgenhaas: Plugin "Entity: set field value" not working if using token for new field value
  • #3332070 by jurgenhaas, mxh, NicholasS, abx: WSOD when adding entity load events with user entity type
  • #3337163 by mxh, jurgenhaas: Deprecated function: str_contains(): Passing null to parameter #1 ($haystack) of type string is deprecated in Drupal\eca\Entity\Eca->isValidationDisabled()
  • #3337999 by mxh, jurgenhaas, wye79: eca_form: Ajax handler does not work for checkboxes in content entity forms
  • #3340582 by jurgenhaas, gjonc: Book token doesn't work in pathauto while ECA is enabled
  • #3341997 by jurgenhaas, heliogabal: Cannot use object of type PluralTranslatableMarkup as array
  • #3343459 by jurgenhaas, djdevin, danielspeicher: TypeError: Argument 2 passed to Drupal\eca_content\HookHandler::prepareForm() must be of the type string, null given
  • #3344752 by boromino, mxh, jurgenhaas: Config read without overridden always empty
  • #3346508 by mxh, jurgenhaas: eca_form: Form field actions are not working well for multi-property fields
  • #3347150 by mxh, jurgenhaas: eca_access: Determining entity field access event does not provide the field name as token
  • #3347247 by jurgenhaas, PhilY: Help needed: 'delay/schedule a task' full example requested
  • #3350171 by mxh: Some machine name fields prevent usage of tokens
  • #3350183 by mxh, jurgenhaas: Cache contexts and invalidation are insufficiently covered
  • #3350826 by mxh: eca_form: "Entity form: build entity" may lead to a fatal when using custom submit buttons
  • #3350893 by mxh: eca_content: "Entity: create new" has the Entity field input which does not make sense
  • #3351155 by mxh: Access denied to Form field: set as disabled (eca_form_field_disable)
  • #3351183 by mxh, sgroundwater, jurgenhaas: Set Validation Error, empty value support
  • #3352137 by danielspeicher, jurgenhaas: CurrentFormDataProvider does not accept Entity References
  • #3352148 by jurgenhaas, danielspeicher: Output from action ViewsExport is always empty
  • #3353177 by mxh: Form field: Validation error at wrong field using inline forms
  • #3354165 by mxh: eca_access: Access events are not consistently providing entity info as token
  • #3354406 by mxh, jurgenhaas: eca_form: Ajax using limited validation errors leads to faulty reads of submission values
  • #3354460 by mxh, jurgenhaas: eca_render: Action "Render: Unserialize" does not work for "array" data type
  • #3355617 by mxh: eca_render: Event for rendering a Views field does not provide info about according View
  • #3356682 by mxh: Form field actions for multi-property fields
  • #3357065 by mxh: eca_config: Action "Config: write" does not support scalar tokens
  • #3357328 by mxh: eca_form: "Form field: set as disabled" not working well for textarea widgets
  • #3358608 by mxh: eca_form: Action "Form field: set options" is missing token support on the field name
  • #3360098 by mxh: eca_form: Action "Form field: set options" may lead to an illegal choice error
  • #3360158 by mxh: ECA Add Ajax Handler keep refreshing and scroll page back to Ajax area
  • #3365680 by mxh: eca_content: Reference Selection event does not work when entity type is not restricted
  • #3366468 by lexsoft, jurgenhaas: Condition: field value changed - not working for booleans
  • #3368763 by gombi, PCate: The spaceless tag is deprecated since Twig 2.7
  • #3369325 by jurgenhaas, mxh, freelock, bradjones1: ECA Access with JSONAPI - "The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early. Returned object class: Drupal\\jsonapi\\CacheableResourceResponse."
  • #3374800: ECA Access and ECA Render are not providing entity tokens
  • #3378283 by jurgenhaas, joelseguin: Webform access tokens do not get replaced when ECA is enabled
  • #3379510 by mxh: eca_form: Action "Form field: set default value" does not support checkboxes
  • #3383905 by danielspeicher, jurgenhaas, Grimreaper, mxh: Set field value does not set trimmed token
  • #3395591 by jurgenhaas: ECA Form: Invalid array key type array in \Drupal\eca_render\Plugin\Action\RenderElementActionBase::execute
  • #3396915 by jurgenhaas: ECA Log: the context array can contain invalid data types for DTO
  • #3404927: “Form field: exists” condition does not support tokens
  • #3408307: Pedantic spelling/grammatical error
  • #3415579 by mxh, jurgenhaas, qichanghai: ECA Render: use token for render link fails
  • #3417097 by ergonlogic: Errors thrown during cron when delayed actions are not yet due for processing
  • #3419231 by jurgenhaas: ECA Render: Validation of machine_name config fields fails for nested fields
  • #3422101 by jurgenhaas, SirClickalot, danielspeicher: ECA Content knocks out "Promote content to front page" and "Make content sticky" Admin actions
  • #3423765: Weight property for ECA entities should be set to a default value
  • #3423989: Test in \Drupal\Tests\eca_config\Kernel\ConfigEventsTest::testConfigCrudEvents fails
  • #3432004: ECA Access: Incorrect field name in "Determining entity field access" plugin
  • #3435881: eca_entity_field_value_changed doesn't work for the status field
  • #3435964: Fix redirect test
  • #3436109: Delayed queue items should be requeued for later processing
  • #3444445: class Drupal\eca_render\Plugin\Action\GetActiveTheme does not have a method "alwaysFalse"
  • #3446349 by jurgenhaas: Fix compatibility with Drupal 11
  • #3450031 by jurgenhaas: Validation for select fields with token option fails
  • #3451432 by jvogt, jurgenhaas: ECA Form: mode token not set
  • #3452494 by jurgenhaas, danielspeicher: ECA Form: inline entity form not recognized in specific context
  • #3452896 by jurgenhaas: Exporting models should remove uuid and _core properties from config entities

Misc

  • Add logo for project browser
  • Cleanup code style for PHP 8.1 and Drupal 10.3
  • Configure PHPStan tests
  • Do not allow PHPCS to fail
  • Enable GitLab CI
  • Fix tests for Drupal 11
  • Update Drupal core dependency to require ^10.3 or ^11
  • Fix test dependencies
VCS Label
2.0.0
Release type
Packaged Git sha1
a68ac1ba251f0e49608fad5e3095242e4a8fd4f4
Release files
5cdabe0c1a6ec67e365585d459b0bae1
Release file SHA-1 hash
abcd19c16ccb4888ec81f691c87876259323bee0
Release file SHA-256 hash
1e972719558ceec38eecadcff2dcb1dfdd75c11b551ffcb5600a5da721ee12b0
b79ee84614efb6ff0ba3f936442f45d4
Release file SHA-1 hash
dff1fe5c079120e8a760e7bc0f38e2e8b99cd7e4
Release file SHA-256 hash
39553ffe35a0d0b9aa6ec8edc3a394137d069b0a718373e5ae72f9c8df079558