BlockedIp::import violates MigrateDestinationInterface::import

Created on 25 January 2022, over 2 years ago
Updated 27 January 2023, over 1 year ago

Problem/Motivation

\Drupal\ban\Plugin\migrate\destination\BlockedIp migrate destination plugin's import method violates \Drupal\migrate\Plugin\MigrateDestinationInterface::import, because it doesn't return anything (so its return value is NULL. This triggers a migration message in MigrateExecutable.

Steps to reproduce

Execute d7_blocked_ips migration and then check the migration messages.

Proposed resolution

Since the IPs are unique, and since the destination plugin already declares that it identifies the migrated rows with the blocked IP address, add a return statement:
return ['ip' => $row->getDestinationProperty('ip')];

Remaining tasks

Patch + test.

User interface changes

Nothing.

API changes

Nothing.

Data model changes

Nothing.

Release notes snippet

Not needed.

πŸ› Bug report
Status

Fixed

Version

9.5

Component
MigrationΒ  β†’

Last updated about 6 hours ago

Created by

πŸ‡­πŸ‡ΊHungary huzooka Hungary πŸ‡­πŸ‡ΊπŸ‡ͺπŸ‡Ί

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024