Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
1. The module generates Drupal\migrate\Plugin\Exception\BadPluginDefinitionException after migrating to Drupal9
Steps to reproduce
1. Install user hash module in Drupal7 site.
2. Migrate the site to Drupal 9.
3. BadPluginException occurs
4. Check for the user hash configuration in Drupal 9.
5. The configuration on Drupal 9 doesn't match the Drupal 7 configuration.
Proposed resolution
NA
Remaining tasks
NA
User interface changes
NA
API changes
NA
Data model changes
NA
Comment | File | Size | Author |
---|---|---|---|
#2 | configuration_missing-3232037-2.patch | 1.64 KB | srishtiiee |
Comments
Comment #2
srishtiiee CreditAttribution: srishtiiee at Acquia commentedAttached a patch here
Comment #3
srishtiiee CreditAttribution: srishtiiee at Acquia commentedComment #4
Wim LeersI first thought this was unnecessary, but … it is necessary! This variable is from the
user_hash
module, and by default thevariable
plugin looks at variables from thesystem
module.So … this makes perfect sense :)
The configuration for the
user_hash
module was not yet being migrated!Without these settings, it's impossible to correctly interpret the hashes … because you need to know the settings that generated them in order for the migrated values to make sense.
If you do not specify the
source_module
key, then the source plugin is available always, even when theuser_hash
module is not installed on the source site.IOW: if you install the
user_hash
module in Drupal 8 or 9 while running a migration, the absence of this key would cause a SQL error — because thehash
column will not exist in theusers
table.Drupal core does not migrate user zero (the anonymous user). In Drupal 8|9, this is configuration, not an actual
User
entity.See
\Drupal\user\Plugin\migrate\source\d7\User::query()
, which also does:As you can see: exactly the same condition!
Without this added condition, the
user_hash
migration always reports one more row to migrate than there are users to migrate! 😨😅Comment #6
jurgenhaasThanks for the patch @srishti.bankar and for the review @Wim Leers, just committet the changes and will publish a new release soon.
Comment #7
srishtiiee CreditAttribution: srishtiiee at Acquia commentedComment #8
srishtiiee CreditAttribution: srishtiiee at Acquia commentedComment #9
srishtiiee CreditAttribution: srishtiiee at Acquia commented