Skip to content

Commit

Permalink
Merge pull request #408 from localgovdrupal/2.x
Browse files Browse the repository at this point in the history
PR ahead of 2.3.5 release
  • Loading branch information
andybroomfield authored Dec 9, 2021
2 parents 85df933 + 29f4254 commit 81ec1dd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"drupal/gin_login": "^1.0@RC",
"drupal/gin_toolbar": "^1.0@beta",
"drupal/simple_sitemap": "^3.7",
"drupal/search_api": "1.20",
"drupal/search_api": "^1.21",
"drush/drush": ">=10",
"localgovdrupal/localgov_alert_banner": "^1.2.0",
"localgovdrupal/localgov_base": "^1.0.0",
Expand Down Expand Up @@ -64,7 +64,7 @@
"Fix schema for gin_toolbar, see https://www.drupal.org/project/gin_login/issues/3192526": "https://www.drupal.org/files/issues/2021-01-13/gin_login-config_schema-3192526-8.patch"
},
"drupal/search_api": {
"Fix exported schema for search_api views, see https://www.drupal.org/project/search_api/issues/3196990": "https://www.drupal.org/files/issues/2021-05-10/3196990-10--views_wrong_query_type.patch"
"Fix schema for search_api views, see https://www.drupal.org/project/search_api/issues/3196990": "https://www.drupal.org/files/issues/2021-11-13/3196990-15-wrong_query_type.patch"
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions localgov.install
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

use Drupal\user\Entity\User;
use Drupal\search_api\Entity\TaskStorageSchema;

/**
* Implements hook_install().
Expand All @@ -21,3 +22,18 @@ function localgov_install() {
$user->roles[] = 'administrator';
$user->save();
}

/**
* Run the potentially skipped search_api_update_8107() safely.
*/
function localgov_update_8201() {
$module_handler = \Drupal::moduleHandler();
if ($module_handler->moduleExists('search_api')) {
$manager = \Drupal::entityDefinitionUpdateManager();
$entity_type = $manager->getEntityType('search_api_task');
if ($entity_type->getHandlerClass('storage_schema') != TaskStorageSchema::class) {
$entity_type->setHandlerClass('storage_schema', TaskStorageSchema::class);
$manager->updateEntityType($entity_type);
}
}
}

0 comments on commit 81ec1dd

Please sign in to comment.