Install

Works with Drupal: 8.x

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 980.51 KB
MD5: feb712fc873dc46526e0abb23210d2da
SHA-1: eea046fbcfab80d056bfd29ede828806cce53fe4
SHA-256: 7fce8771c6459647d5ba3cc3ff52b6fbc96fa75ff0cb67624d67de8cd323d5d1
Download zip 1.16 MB
MD5: eeeca103408b1fc7e0d5b1f86bece2fb
SHA-1: f387e6d3cf0d065143c2fec45277d57223e64bb5
SHA-256: f429a18146064e3883281fff01e7d03aa32a1a0af664b9d2d42f76055b8cfd9f

Release notes

The most important changes in this release are:

  • FeedsAnnotationFactory got deprecated
  • Three new events
  • Base class for transforming data after parsing: AfterParseBase

This release also contains some minor UX improvements. For example, during a cron import you can now track progress on the feed page.

This release requires at least Drupal 8.6.0. The next release will require at least Drupal 8.7.0.

FeedsAnnotationFactory got deprecated

This class used to allow you to specify service dependencies in the annotation of a Feeds plugin. This is problematic because any plugins extending an existing Feeds plugin are required to declare the same dependencies. And one of the services used by many Feeds plugins is @entity.query, which got deprecated in Drupal 8.3.0.
The use of @entity.query in Feeds plugins will be removed in the next release. This means that if you have plugins that depend on this service, they will keep working for now, but may get broken in the next release. Plugins that for example could get broken are:

  • Processor plugins (extending \Drupal\feeds\Feeds\Processor\EntityProcessorBase)
  • Target plugins that extend \Drupal\feeds\Feeds\Target\File

For more information about FeedsAnnotationFactory, see #3062533: Deprecate FeedsAnnotationFactory and let Feeds plugins use ContainerFactoryPluginInterface for dependency injection
Issue in which @entity.query will be removed: #3001376: entity.query deprecated warnings

The next release is planned for February/March 2020.

Three new events

  • FeedsEvents::PROCESS_ENTITY_PREVALIDATE
    This allows you to hook in the process stage just before validation. Useful if you want to fix validation issues.
  • FeedsEvents::PROCESS_ENTITY_PRESAVE
    Useful if you want to act on an entity before it is being saved, with the possibility to access the item that was processed. In the regular entity presave hook, you are missing context about the import.
  • FeedsEvents::PROCESS_ENTITY_POSTSAVE
    Similar as above: if you want to act on an entity after it is saved, in the context of a Feeds import.

Base class for transforming data after parsing: AfterParseBase

If you want to manipulate the source data and the transformations that you want to apply are too complex to handle with Feeds Tamper, you want to listen to the FeedsEvents:PARSE event. The base class \Drupal\feeds\EventSubscriber\AfterParseBase makes this a little easier for you. Just extend the class and implement ::alterItem() for your transformations. Also, be sure to override ::applies() if you only want to apply the transformations for some feeds types. Do register the event subscriber in your *.services.yml file (just as any other event subscriber).
As a bonus, you can throw \Drupal\feeds\Exception\SkipItemException to skip an item from being imported. Keep in mind this works solely with classes that extend AfterParseBase, not with custom event subscribers.

Contributors (16)

MegaChriz, Dinesh18, Omar Alahmed, ksc, carolpettirossi, chadrossouw, SpadXIII, sajosh, andileco, Daniel Korte, Dropa, Odai Atieh, thalles, veronicaSeveryn, vijay.mayilsamy, artematem

Changelog

Issues: 20 issues resolved.

Changes since 8.x-3.0-alpha5:

Bug

Feature

Support

Task

  • #3079932 by MegaChriz: Fixed tests for Drupal 8.8: pass the event dispatcher to AccountProxy.
  • #3087672 by MegaChriz: Fixed tests for D8.8.
  • #3062533 by MegaChriz: Deprecate FeedsAnnotationFactory and let Feeds plugins use ContainerFactoryPluginInterface for dependency injection.
  • #3052870 by thalles: Replaced deprecated method cacheUntilEntityChanges.
  • #3046661 by thalles, MegaChriz: Replaced deprecated trait EntityReferenceTestTrait.
  • #3079395 by Dropa: Replaced deprecated datetime constants with the ones from DateTimeItemInterface.

Missing features

This being an alpha release means that not all features from the D7 version of Feeds have been ported yet. You may also run into some bugs.
The most notable missing features are:

Beta blockers and beta targets

Created by: megachriz
Created on: 27 Oct 2019 at 10:00 UTC
Last updated: 1 Mar 2020 at 19:41 UTC
Bug fixes
New features

Other releases