You are here

function social_core_update_10201 in Open Social 10.2.x

Resets the update hooks to 10201 for following modules.

1. Social Book 2. Social Event 3. Social Landing page 4. Social Page 5. Social Profile 6. Social Topic.

These update hooks were added in cherry-pick accidentally.

See also

https://github.com/goalgorilla/open_social/commit/6a0007a8adf813a4cff1fc...

File

modules/social_features/social_core/social_core.install, line 1384
Install, update and uninstall functions for the social_core module.

Code

function social_core_update_10201(&$sandbox) {

  // Prepare the range of update hook numbers which needs to be removed.
  $update_numbers = [
    '10301',
    '10302',
    '10303',
  ];

  // The modules whose schema needs to be reset.
  $modules = [
    'social_book',
    'social_event',
    'social_landing_page',
    'social_page',
    'social_profile',
    'social_topic',
  ];

  // Check if the update hook number already exists in schema and then
  // reset.
  foreach ($modules as $module) {
    $latest_schema = \Drupal::keyValue('system.schema')
      ->get($module);
    if (in_array($latest_schema, $update_numbers)) {
      \Drupal::keyValue('system.schema')
        ->set($module, '10201');
    }
  }
}