Problem/Motivation
Drupal 7 Migration missing for global settings.
Proposed resolution
Add migration.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 3238953-13.migrate_global_d7_settings.patch | 4.58 KB | jonathan1055 |
Issue fork scheduler-3238953
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
omkar.podey commentedComment #3
omkar.podey commentedComment #4
omkar.podey commentedCorrected Kernel test and fixtures for migrating configuration.
Comment #5
narendrarComment #6
huzookaTrying make DrupalCI execute kernel tests.
Comment #7
huzooka#4: Excellent work! Some nits but nothing major:
Drupal 7 Scheduler does not set a default value for
scheduler_allow_date_onlyon install. This variable is only saved in the database if the config form is submitted. This means that thescheduler_allow_date_onlyvariable might be completely missing in Drupal 7.If we search in Drupal 7 Scheduler's codebase for the
variable_get('scheduler_allow_date_only'expression, we can see that the logical default value isFALSE.If we use the default_value process plugin, we can handle this edge case as well:
Same situation as above: Based on the results of a very similar search (for
variable_get('scheduler_default_time'), the logical default value is'00:00:00', please useA file comment is missing from here. Something like this would be perfectly adequate:
Change this to "Tests the migration of Drupal 7 scheduler configuration."
The test on Drupal core 8.9.x fails because of this property. Since Scheduler tries to be compatible with Drupal 8.9.x, this property's visibility should be public (because core 8.9.x requires that this
$modulesproperty is public in Kernel tests). Obviously this will trigger a deprecation notice on Drupal core 9+, but it is better than being unable to execute the test on Drupal core 8.9.x (which is still supported!).The method's comment should say "Tests the migration of scheduler settings.", and I would also change the name of the method to something more specific, like "testConfigurationMigration".
Don't forget to include the
drupalci.ymlchange I added in #6! Otherwise, the kernel test isn't run by DrupalCI.Comment #8
omkar.podey commentedComment #9
omkar.podey commentedRequired changes , Done
Comment #10
huzooka#9 addresses everything from #7.
RTBC.
Great work!
Comment #11
jonathan1055 commentedThank you @omkar.podey and @huzooka this is a good addition.
New features now need to be added to the 2.x branch so I have changed the issue version. However it should all work the same, apart from the patch may need to be re-rolled for drupalci.yml
Comment #12
jonathan1055 commentedActually, it would make sense if I committed the change to drupalci.yml to run
PHPUnit-Kerneltests. Then neither this issue nor #3249050: Add migration of per-nodetype settings from Drupal 7 to 8/9 would have to add it.Comment #13
jonathan1055 commentedNew patch to test at 2.x. Same as #8 except for drupalci.yml
Comment #15
jonathan1055 commentedI have pushed patch #8 / #13 to the Merge Request branch at 2.x
Not done any local testing yet or made any other changes.
Comment #16
wim leersYep, I expect this to behave identically in both versions — based on #3224263: Plan for Scheduler 2.0 release these global settings won't change 👍
Comment #17
jonathan1055 commentedI am having some difficulty testing this locally. I am trying to export from D7 into D8 but the first problem is that the Migrate module does not appear to have been upgraded to support MySQL 8 with the new protected/reserved words.
select from systemfails and requires the table name to be escaped, or enclosed in back-slashes. I thought this was all taken care of in a core fix some time ago in #2966523: MySQL 8 SupportI have hacked
core/modules/migrate_drupal/src/MigrationConfigurationTrait.phpto changeWith this change, the first form validates ok and there are no errors, but I just get sent back to the first page "preparation steps". According to the documentation upgrading-drupal/upgrade-using-web-browser there should be a list of modules that will and will not be imported.
Comment #18
jonathan1055 commentedI have checked all the other global settings and the only other one in D7 which has a comparable setting in D8 is relating to the time entry. In D8 we have
hide_secondswhich can be true or false. In D7 we have the configurable time format, which is not available in D8, however, if the D7 time format does not contain 's' for seconds, then it would be nice to set D8 hide_seconds to TRUE. Maybe that logic can be added in to the custom hooks in #3249050: Add migration of per-nodetype settings from Drupal 7 to 8/9 ?Comment #20
jonathan1055 commentedThanks @omkar.podey, @huzooka, @Wim Leers and @narendraR
Merged and fixed.
Comment #22
jonathan1055 commentedI added a custom migration plugin to set
hide_secondsdepending on whether 's' is contained in the sourcescheduler_date_format, and expanded the test to show it works.