Events to created, updated and failed entity create.

Created on 11 October 2023, over 1 year ago

Motivation

We need events to trigger during the entity create, update, or failed.

Proposed resolution

Add 3 new process events to create, update, fail, and dispatch during the process.

Remaining tasks

API changes

It would add the ability to subscribe to the events at the end.

Feature request
Status

Closed: works as designed

Component

Code

Created by

🇧🇷Brazil aluzzardi Pelotas, RS

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

Comments & Activities

  • Issue created by @aluzzardi
  • 🇧🇷Brazil aluzzardi Pelotas, RS

    I created a patch that can be applied on beta4.

  • Status changed to Closed: works as designed over 1 year ago
  • 🇳🇱Netherlands megachriz

    Responding to created, updated and failed items is already possible.

    Whenever some of these happen, $state->report() is called. \Drupal\feeds\State::report() dispatches a Drupal\feeds\Event\ReportEvent, event key is \Drupal\feeds\Event\FeedsEvents::REPORT. When you call getOperation() on the report event, you can see if the item was:

    • "created" (\Drupal\feed\StateType::CREATE)
    • "updated" (\Drupal\feed\StateType::UPDATE)
    • "deleted" (\Drupal\feed\StateType::DELETE)
    • "skipped" (\Drupal\feed\StateType::SKIP)
    • "failed" (\Drupal\feed\StateType::FAIL)
    • "cleaned" (\Drupal\feed\StateType::CLEAN)

    The Feeds Log module (part of Feeds) subscribes to the report event (\Drupal\feeds_log\EventSubscriber\FeedReportSubscriber).

Production build 0.71.5 2024