Commit 705ac7a1 authored by git's avatar git Committed by Sascha Grossenbacher
Browse files

Issue #2710617 by yongt9412: License key is missing after update

parent 64138176
Loading
Loading
Loading
Loading
+15 −0
Changes for jw_player.install: 15 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -46,3 +46,18 @@ function jw_player_update_8001() {
  drupal_set_message(t('JW Player version has been set to 6.'));
  $config->save();
}

/**
 * Set the jw player key if it already exists.
 */
function jw_player_update_8002() {
  // The configuration variable license_key has been renamed to jw_player_key.
  $config = \Drupal::configFactory()->getEditable('jw_player.settings');
  // Ensure that the jw_player_key is taken from the license_key when updating
  // if the jw_player_key was not already set.
  if ($config->get('license_key') && !$config->get('jw_player_key')) {
    $config->set('jw_player_key', $config->get('license_key'));
    $config->clear('license_key');
    $config->save();
  }
}