Problem/Motivation

A spin-off issue from #3425218: Fix PHPStan errors. In the class Drupal\feeds\Feeds\Target\Book there is a call to an undefined method called addMessage(). A method with that name is defined in \Drupal\feeds\Plugin\Type\Target\FieldTargetBase, but Book doesn't extend that class, but \Drupal\feeds\Plugin\Type\Target\TargetBase instead.

As this proves that additional test coverage is needed, I decided to focus fixing this in a separate issue.

Steps to reproduce

The bug is only reproducable when extending the Book class and throw a \Drupal\feeds\Exception\TargetValidationException in there, because the exception isn't thrown in the class itself. (Well, technically it could also be reproduced when swapping the 'feeds.entity_finder' service and throw that exception in there, but that would make less sense in my opinion: the exception is expected to be only thrown in FeedsTarget plugins.)

Proposed resolution

Move the message related methods from \Drupal\feeds\Plugin\Type\Target\FieldTargetBase to \Drupal\feeds\Plugin\Type\Target\TargetBase.

Remaining tasks

  • Add a fix
  • Add test coverage
  • Commit

User interface changes

API changes

Data model changes

MR will come shortly.

Issue fork feeds-3459522

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

Status: Active » Needs review

  • MegaChriz committed 7697fd03 on 8.x-3.x
    Issue #3459522 by MegaChriz: Fixed call to an undefined method Drupal\...
megachriz’s picture

Status: Needs review » Fixed

Merged!

Status: Fixed » Closed (fixed)

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