Problem/Motivation

In Feeds 8.x-3.0-rc1 a new parameter was added to \Drupal\feeds\Feeds\Target\Text::__construct(). This however caused the tests from the module Paragraphs to fail, which has a class that extends
\Drupal\feeds\Feeds\Target\Text and overrides its constructor.

An issue for Paragraphs has been created to fix that: #3473001: Feeds integration: update constructor of FeedsTarget plugin to fix tests

However, meanwhile in the latest stable release of Paragraphs integration with Feeds will be broken. Therefore I think we should make the new added parameter in the Text class optional and trigger a deprecation warning for it.

And then schedule a 8.x-3.0-rc2 release.

Steps to reproduce

  • Install Feeds 8.x-3.0-rc1
  • Install Paragraphs 8.x-1.18
  • Add a paragraphs field to a content type.
  • Add a feed type and try to add mapping for the paragraphs field.

The following error may then appear or get logged:

ArgumentCountError: Too few arguments to function Drupal\feeds\Feeds\Target\Text::__construct(), 4 passed in /paragraphs/src/Feeds/Target/Paragraphs.php on line 48 and exactly 5 expected in Drupal\feeds\Feeds\Target\Text->__construct() (line 56 of /feeds/src/Feeds/Target/Text.php).

Proposed resolution

Make the parameter $filter_format_storage optional and issue a deprecation warning instead.

Remaining tasks

  • Draft a change record.
  • Make the parameter $filter_format_storage in \Drupal\feeds\Feeds\Target\Text::__construct() optional.
  • Trigger an error with a deprecation warning for the newly added optional constructor parameter that is not set.
  • Update phpstan.neon to ignore the dependency injection issue.
  • Commit.
  • Publish the change record.

User interface changes

None.

API changes

\Drupal\feeds\Feeds\Target\Text::__construct() will get an optional additional parameter. An error with a deprecation warning is triggered when not set.

Data model changes

None.

Issue fork feeds-3473599

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

megachriz created an issue. See original summary.

megachriz’s picture

megachriz’s picture

Issue summary: View changes

  • megachriz committed 09fab664 on 8.x-3.x
    Issue #3473599 by megachriz: Added deprecation warning for new required...
megachriz’s picture

Status: Active » Fixed

All checks are green. Merged!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.