/**
 * Issue #3085671: Fix the update process to uninstall the Simple Oauth Extras
 * module as it was merged into Simple Oauth to make it work without conditions.
 */
function varbase_api_update_8702() {

  $simple_oauth_extras_config_factory = \Drupal::configFactory()
    ->getEditable("simple_oauth_extras.settings");
  $simple_oauth_extras_settings = $simple_oauth_extras_config_factory->get();

  if (isset($simple_oauth_extras_settings['use_implicit'])) {
    $simple_oauth_config_factory = \Drupal::configFactory()
      ->getEditable("simple_oauth.settings");

    $simple_oauth_settings = $simple_oauth_config_factory->get();

    if (!isset($simple_oauth_settings['use_implicit'])) {
      $simple_oauth_settings['use_implicit'] = $simple_oauth_extras_settings['use_implicit'];
      $simple_oauth_config_factory->setData($simple_oauth_settings)->save(TRUE);
    }

    $simple_oauth_extras_config_factory->delete();
  }

  $query = \Drupal::database()->delete('key_value')
    ->condition('collection', 'system.schema')
    ->condition('name', 'simple_oauth_extras')
    ->execute();

  // Entity updates to clear up any mismatched entity and/or field definitions
  // And Fix changes were detected in the entity type and field definitions.
  \Drupal::classResolver()
    ->getInstanceFromDefinition(VarbaseEntityDefinitionUpdateManager::class)
    ->applyUpdates();
}

The Notice after updating simple_oauth : The following module is missing from the file system

After the update hook for simple_oauth dev varbase80701

After the update hook for simple_oauth

The following module is missing from the file system -- simple_oauth_extras dev varbase80701

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RajabNatshah created an issue. See original summary.

  • RajabNatshah committed 1c814a2 on 8.x-7.x
    Issue #3085671: Fix the update process to uninstall the Simple Oauth...
Rajab Natshah’s picture

Issue summary: View changes
Rajab Natshah’s picture

Assigned: Rajab Natshah » Mohammed J. Razem
Status: Active » Needs review
Issue tags: +varbase-8.7.2
Rajab Natshah’s picture

Assigned: Mohammed J. Razem » Unassigned
Rajab Natshah’s picture

Status: Needs review » Fixed
Rajab Natshah’s picture

Rajab Natshah’s picture

Issue summary: View changes
Rajab Natshah’s picture

Issue summary: View changes
Rajab Natshah’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.