diff -u b/core/modules/system/system.install b/core/modules/system/system.install --- b/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1758,11 +1758,6 @@ 'cron_threshold_warning' => 'threshold.requirements_warning', 'cron_threshold_error' => 'threshold.requirements_error', )); - - if ($cron_key = update_variable_get('cron_key', FALSE)) { - state()->set('system.cron_key', $cron_key); - } - update_variable_del('cron_key'); } /** @@ -2204,6 +2199,15 @@ } /** + * Moves cron_key from variable to state. + * + * @ingroup config_upgrade + */ +function system_update_8033() { + update_variables_to_state(array('cron_key' => 'system.cron_key')); +} + +/** * @} End of "defgroup updates-7.x-to-8.x". * The next series of updates should start at 9000. */ only in patch2: unchanged: --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/StateSystemUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/StateSystemUpgradePathTest.php @@ -35,6 +35,10 @@ public function testSystemVariableUpgrade() { $expected_state = array(); + $expected_state['system.cron_key'] = array( + 'value' => 'kdm95qppDDlyZrcUOx453YwQqDA4DNmxi4VQcxzFU9M', + 'variable_name' => 'cron_key', + ); $expected_state['update.last_check'] = array( 'value' => 1304208000, 'variable_name' => 'update_last_check', only in patch2: unchanged: --- a/core/modules/system/tests/upgrade/drupal-7.state.system.database.php +++ b/core/modules/system/tests/upgrade/drupal-7.state.system.database.php @@ -19,3 +19,7 @@ ->key(array('name' => 'update_last_email_notification')) ->fields(array('value' => serialize(1304208000))) ->execute(); +db_merge('variable') + ->key(array('name' => 'cron_key')) + ->fields(array('value' => serialize('kdm95qppDDlyZrcUOx453YwQqDA4DNmxi4VQcxzFU9M'))) + ->execute();