Problem/Motivation
As of 2022-12-27 / eu_cookie_compliance-8.x-1.24 (likely since #3264116: Migration from D7 to D9), I can confirm that this module properly migrates my EU Cookie Compliance settings from Drupal 7 to Drupal 9. Thank you very much for your hard work to make this easy for me!
As of Drupal core 8.8.x, modules can declare their Drupal 8 (or 9) upgrade status (changelog, issue #2936365: Migrate UI - allow modules to declare the state of their migrations). Failing to do so makes it seem as if this module has no migrations and/or is not ready to be upgraded... for example, see the following image...

... this could be a barrier preventing other people from upgrading their sites to Drupal 8/9/10+.
Steps to reproduce
- Set up a Drupal 7 site. Download and install
eu_cookie_compliance-7.x-1.43, and change some settings. - Set up a Drupal 9 site with the Standard install profile. Download and install
eu_cookie_compliance-8.x-1.24. Enable core'smigrate,migrate_drupal, andmigrate_drupal_uimodules. - As an administrator, visit
/upgradeto begin the Drupal-to-Drupal migration. Proceed through the wizard to the "What will be upgraded?" step.- Expected behaviour: "EU Cookie Compliance" is in the "Modules that will be upgraded" section.
- Actual behaviour: "EU Cookie Compliance" is in the "Modules that will not be upgraded" section.
- Click "Perform upgrade" and wait for the upgrade to finish.
- Check the EU Cookie Compliance settings at
/admin/config/system/eu-cookie-compliance- note the custom settings were migrated from D7 so the migration is working.
Proposed resolution
Declare the finished upgrade path from D7 by creating a migrations/state/eu_cookie_compliance.migrate_drupal.yml and populating it appropriately.
Remaining tasks
Write a patch- Review and feedback
- RTBC and feedback
- Commit
- Release
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3329990-3--declare-eu_cookie_compliance-migration-status.patch | 1.9 KB | mparker17 |
Issue fork eu_cookie_compliance-3329990
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:
- 3329990-declare-upgrade-status
changes, plain diff MR !114
Comments
Comment #3
mparker17I've made my changes in merge request !114; but here's a patch for folks who prefer that method.
Setting to Needs Review to see if Testbot has any suggested improvements.
Reviews are welcome!
Comment #4
mparker17(slight issue summary change)
Comment #5
mparker17Hmm... the test failure is in the other migration test, i.e.: the pre-existing migration test, i.e.: not the migration test added in this ticket.
By my own observation, the migrations work fine even if the old test doesn't, so I daresay that's outside of the scope of this issue.
Looking at the failure, it's a
Uncaught AssertionError: The container was serialized. in /var/www/html/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php:160being thrown before any tests are run. I don't see that when I run the migration manually, so it seems like this is a problem with the test, not the production code. It isn't particularly clear where this is happenign, but the only part that deals with the service container is in\Drupal\Tests\eu_cookie_compliance\Kernel\EuCookieComplianceMigrateTest::getFixtureFilePath(), so perhaps the fix is...... but I'm not certain if that will work. And, I'm conscious that iterating on the problem in this thread may derail this issue.
Maintainers: given the above information, would you like me to try to fix that here, or in a separate ticket?
Comment #6
svenryen commentedI set up a D7 site, and migrated the settings of EU Cookie Compliance to D9. The interface properly tells me that the settings will be migrated and after migration I do see the same settings in the D9 site as I did in the D7 site.
Thanks for the patch!
Comment #8
svenryen commented