More actions for Previously imported items

Created on 12 January 2023, almost 2 years ago

Problem/Motivation

I volunteer with a local court and every morning need to import the hearings scheduled for the next three months. I use Feeds to automatically import each hearing into a node each day. The court doesn't list the hearings that are cancelled or in the past. In looking into ways to deal with this it occurred to me that if Feeds had an option to specify a field to modify in the Processer Settings | Previously imported items it would be a useful feature to folks who need to modify a previously imported node in a more general way than the few offered.

Proposed resolution

Add an option(s) to Processer Settings | Previously imported items to specify a field in the previously imported node and a change to be made to it. For example, specify a boolean field on the nodes to be true or false, or specify a text field and a string to be placed in it.

✨ Feature request
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States pwarn Vermont

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΈπŸ‡ͺSweden thomjjames Sweden

    Hi,

    I needed something similar for this, importing sports matches so wanted to set a match "status" field to "result" when the item was no longer available in the live feed.

    You have to create a new non-configurable (no options) action for it to show up, take a look at core/lib/Drupal/Core/Action/Plugin/Action/SaveAction.php as an example. In the execute method you'd need to set your boolean field value something like:

      /**
       * {@inheritdoc}
       */
      public function execute($entity = NULL) {
        $entity
          ->set('field_match_status', 'result')
          ->setChangedTime($this->time->getRequestTime())
          ->save();
      }
    

    Hope that helps
    Tom

Production build 0.71.5 2024