forked from alxp/islandora
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f4e661
commit fe7e450
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
modules/islandora_core_feature/islandora_core_feature.post_update.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Post-update hooks. | ||
*/ | ||
|
||
/** | ||
* Add index to field_weight. | ||
*/ | ||
function islandora_core_feature_post_update_add_index_to_field_weight() { | ||
$storage = \Drupal::entityTypeManager()->getStorage('field_storage_config'); | ||
$field = $storage->load('node.field_weight'); | ||
$indexes = $field->getIndexes(); | ||
$indexes += [ | ||
'value' => ['value'], | ||
]; | ||
$field->setIndexes($indexes); | ||
$field->save(); | ||
} |