Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index field_weight's value. #924

Merged
merged 1 commit into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
indexes:
value:
- value
persist_with_no_fields: false
custom_storage: false
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();
}