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
Running migrate-import using drush/drush:^10 from a drupal 6 site to drupal 8.8. The drupal 6 site has core search enabled.
An exception is thrown from Drupal\search\Plugin\ConfigurableSearchPluginBase::setConfiguration()
TypeError: Argument 1 passed to Drupal\search\Plugin\ConfigurableSearchPluginBase::setConfiguration() must be of the type array, null given, called in /var/www/sites/abcdef/web/core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php on line 106 in Drupal\search\Plugin\ConfigurableSearchPluginBase->setConfiguration() (line 46 of /var/www/sites/abcdef/web/core/modules/search/src/Plugin/ConfigurableSearchPluginBase.php)
Proposed resolution
Modify the migration so that there is always a configuration array that is, by default, empty. These are plugins and plugins have a configuration array, so let't make sure one is available.
Remaining tasks
Review
Commit
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
Comment | File | Size | Author |
---|---|---|---|
#16 | 3092430-16.patch | 3.23 KB | quietone |
#16 | 3092430-16-fail.patch | 2.24 KB | quietone |
#14 | 3092430-14.patch | 3.23 KB | quietone |
#14 | 3092430-14-fail.patch | 1.46 KB | quietone |
#13 | searchconfig.patch | 974 bytes | Shrutidkadam |
Comments
Comment #2
mattpainter CreditAttribution: mattpainter commentedSame issue here, upgrading from a Drupal 6.38 install - which includes a whole tonne of old, unmaintained modules - to a fresh Drupal 8.7.10 install.
Not sure if this is of any relevance, but when I tried again but didn't specify the static files path, the migration worked - however, of course, wasn't that useful.
Comment #3
yookoala CreditAttribution: yookoala commentedI just encountered the same problem on Drupal 8.8.1. Had to disable the Search module on Drupal 6 in order to successfully migrate.
Comment #4
HongPong CreditAttribution: HongPong commentedfwiw i had to remove drush/drush drush v10 from the vendor folder and fall back to drush 8 in my local user bin and then it worked (from drupal 6)
Comment #5
geerlingguy CreditAttribution: geerlingguy at Midwestern Mac, LLC commentedI'm getting the former notices (
Field discovery failed for Drupal core version 7.
) before the following migrations:Tracking this issue here: Getting 'Field discovery failed for Drupal core version 7.' when migrating
Comment #6
mradcliffeI ran into this issue as well. I edited the issue summary to contain only the back trace and the exception.
Comment #7
RdeBoerI just had this too on a D7 to D8 migration. I patched the code to fix this.
File core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php, change function updateEntity() (line 100) to read like this:
This for me resulted in the migration going through without an errors or warnings.
Comment #8
jpdw CreditAttribution: jpdw commentedI encountered the same issue on another D7 to D8 (8.9) migration.
RdeBoer's patch (#7) appeared to work for me too, albeit path to file was slightly different core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php
Comment #9
RdeBoer@jpdw Thanks -- typo on my behalf. I've corrected the file path in #7.
Comment #10
vistree CreditAttribution: vistree commented#7 seems to fix the warnings for a D6 to D8 migration also ;-)
Comment #11
heddnGiven the solution in #7 is in core, not migrate upgrade module, moving queues.
Comment #13
Shrutidkadam CreditAttribution: Shrutidkadam commented#7 seems to be working, i have added its patch file for the same
Comment #14
quietone CreditAttribution: quietone as a volunteer commented@bgprior, Thanks for reporting the error, and to RdeBoer and shrutidkadam for the fix and patch.
I think the better solution is to alter the migration to make sure that there is always a configuration array on the row. That is because the destination is a plugin, which has a configuration array. It seems to me that the migration should be providing that. Therefor, the migration yamls are modified to ensure that there is a configuration array.
Attached is a fail and success path. I have update the title to focus on the fix (and be shorter) and updated the IS.
Comment #15
quietone CreditAttribution: quietone as a volunteer commentedFix title
Comment #16
quietone CreditAttribution: quietone as a volunteer commentedOops, wrong fail patch. Let's start over.
Comment #18
danflanagan8@quietone, that is an elegant fix! And the test looks great. It produces exactly the error message we were looking for. And it even has nice comments.
I tested this by deleting all of the
node_rank_%
rows manually from the drupal7 fixture. Then I spun up a D7 with that fixture. Then I used migrate_drupal_ui to upgrade that D7 site to a D9 site. I quickly received the following error:TypeError: Drupal\search\Plugin\ConfigurableSearchPluginBase::setConfiguration(): Argument #1 ($configuration) must be of type array, null given, called in /var/www/html/core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php on line 106 in Drupal\search\Plugin\ConfigurableSearchPluginBase->setConfiguration() (line 46 of /var/www/html/core/modules/search/src/Plugin/ConfigurableSearchPluginBase.php)
Just like in the IS and in your test.
After that I applied the patch and repeated the steps. This time the migration was smooth. The node search page on the D9 site looks great. It ends up with the following yml (with uuid stuff removed) which looks totally healthy:
And the search page works after I index. This looks great.
Comment #19
benjifisherFor some reason, the patch in #16 is not being tested automatically even though this issue is RTBC. I just queued a retest.
Comment #21
alexpottCommitted and pushed 331e284ef00 to 10.0.x and 62dc0bc471e to 9.4.x and d764daae297 to 9.3.x. Thanks!