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.
Comment | File | Size | Author |
---|---|---|---|
#11 | 3260391-11.patch | 2.08 KB | Spokje |
| |||
#11 | interdiff.2-11.txt | 560 bytes | Spokje |
#2 | core-migrate_banip_destination-3260391-2--complete.patch | 1.45 KB | huzooka |
| |||
#2 | core-migrate_banip_destination-3260391-2--test-only.patch | 911 bytes | huzooka |
Issue fork drupal-3260391
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
Comment #2
huzookaComment #4
quietone CreditAttribution: quietone at PreviousNext commentedYes, this does bring the BlockIp import destination in line with the interface.
I applied the patch to prove to myself that before this patch the migrate_map_d7_blocked_ips was empty was empty and filled after the patch was applied. And it was.
Thanks @huzooka
Comment #9
arunkumarkRe-rolled the patch to work with 10.0.x version.
Comment #10
SpokjeComment #11
SpokjeComment #12
SpokjeComment #13
longwaveThanks @Spokje. This is RTBC as per #4 with the additional removal of the baseline entry for PHPStan.
Comment #14
alexpottCommitted and pushed 4936c9bd07 to 10.1.x and 8d6284210f to 10.0.x. Thanks!
Committed 90e026f and pushed to 9.5.x. Thanks!
I backported this to D9.5 because only the phpstan changes are not relevant.
Comment #15
alexpott