Install
Works with Drupal: 8.xUsing Composer to manage Drupal site dependencies
Alternative installation files
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
- #2975826 by MegaChriz, Omar Alahmed, ksc, carolpettirossi, chadrossouw: When looking for an entity with the same name, restrict search to entities within the same bundle.
- #3078857 by SpadXIII, MegaChriz: Fixed wrong action ID's listed for "Previously imported items" option.
- #3086342 by MegaChriz: Fixed $feed->getState() can return NULL while it should always return an instance of StateInterface.
- #3063789 by Daniel Korte: Fixed "Settings can not be serialized" error when returning RawFetcherResult from fetcher.
- #3042062 by MegaChriz, Odai Atieh: Fixed node access prevents Feeds from updating existing (unpublished) content.
Feature
- #2996579 by MegaChriz: Show import progress on feed page (simple solution).
- #2996587 by MegaChriz, Dinesh18: Display machine names of targets on mapping.
- #3074085 by MegaChriz, sajosh: Display descriptions of sources and targets.
- #3080985 by andileco, Dinesh18, MegaChriz: Include an "Explanation or submission guidelines" in the basic settings, like with content types.
- #2772601 by MegaChriz, veronicaSeveryn, vijay.mayilsamy, artematem: Added base class for altering source data after parsing + added exception class for skipping an item.
- #2991955 by MegaChriz: Dispatch events before and after saving an entity during processing.
- #3054851 by MegaChriz: Added an event to dispatch before validation: PROCESS_ENTITY_PREVALIDATE.
Support
- #3066847 by MegaChriz, sajosh: Clarified what to enter for a new CSV source.
- #3070549 by MegaChriz: Clarified on the feed type form that the periodic import setting depends on cron.
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:
- #2867761: Multilingual support (content translation)
- #2938505: Add UI for editing and removing custom (CSV) sources
- #3060930: Add Drush 9 commands in Feeds 8.x-3.x
- Feeds import preview
- #3116987: Don't create new items, only update existing (D8)
- Targets for several field types: media field, user password, user roles