Remove usage of deprecated FeedsAnnotationFactory

Created on 15 June 2024, 5 months ago
Updated 20 August 2024, 3 months ago

Problem/Motivation

The FeedsTarget plugin "paragraphs" uses annotation to specify the services being used in the constructor. This relies on FeedsAnnotationFactory to work, but FeedsAnnotationFactory has been deprecated for more than 4 years now and is about to removed.

When it gets removed, it will cause fatal errors for users that use both Feeds and Paragraphs and when they use the FeedsTarget plugin "paragraphs" in mappings:

TypeError: Drupal\paragraphs\Feeds\Target\Paragraphs::__construct(): Argument #4 ($entity_type_manager) must be of type Drupal\Core\Entity\EntityTypeManagerInterface, Drupal\Core\Session\AccountProxy given, called in /Users/youri/Sites/drupal/modules/d8/wip/feeds8/feeds/src/Feeds/Target/Text.php on line 55 in Drupal\paragraphs\Feeds\Target\Paragraphs->__construct() (line 47 of /Users/youri/Sites/drupal/modules/d8/wip/paragraphs/src/Feeds/Target/Paragraphs.php).

Steps to reproduce

  1. Add a paragraphs field to an entity type, for example to "node".
  2. Add a feed type, select the entity type and bundle that the paragraphs field is on
  3. On the mapping page, map to a paragraphs field.
  4. Apply the changes from 📌 Remove deprecated FeedsAnnotationFactory class Fixed to Feeds (in which the FeedsAnnotationFactory gets removed).

Proposed resolution

Remove the service references from the annotation and inject the services by implementing ContainerFactoryPluginInterface instead.

See also the Feeds change record .

Note: 🐛 Adding a 'Paragraphs' field to a Feed's mapping throws error RTBC has tests for the Feeds integration, you might want to resolve that issue first.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇳🇱Netherlands megachriz

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024