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

CTDA9-404: Avoid warning #9

Merged
merged 2 commits into from
Aug 15, 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
@@ -1,11 +1,11 @@
langcode: en
status: true
dependencies:
config:
- search_api_solr.solr_field_type.text_und_7_0_0
module:
- search_api_solr
- islandora_hocr
config:
- search_api_solr.solr_field_type.text_und_7_0_0
id: islandora_hocr_und_7_0_0
label: 'Language Undefined hOCR Field'
minimum_solr_version: 7.0.0
Expand All @@ -15,7 +15,6 @@ domains: {}
field_type:
name: islandora_hocr_und
class: solr.TextField
storeOffsetsWithPositions: true
analyzers:
-
type: index
Expand Down Expand Up @@ -61,9 +60,9 @@ field_type:
filters:
-
class: solr.SynonymGraphFilterFactory
ignoreCase: true
synonyms: synonyms_und.txt
expand: true
ignoreCase: true
-
class: solr.StopFilterFactory
ignoreCase: true
Expand All @@ -86,4 +85,9 @@ field_type:
class: solr.LowerCaseFilterFactory
-
class: solr.RemoveDuplicatesTokenFilterFactory
storeOffsetsWithPositions: true
unstemmed_field_type: null
spellcheck_field_type: null
collated_field_type: null
solr_configs: null
text_files: { }
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
langcode: en
status: true
dependencies:
module:
- islandora_hocr
config:
- search_api_solr.solr_field_type.islandora_hocr_und_7_0_0
module:
- islandora_hocr
id: request_handler_select_islandora_hocr_7_0_0
label: Select w/ OCR Highlighting Component
minimum_solr_version: 7.0.0
Expand Down
15 changes: 15 additions & 0 deletions islandora_hocr.post_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,18 @@ function islandora_hocr_post_update_install_initial_entities() {
}

}

/**
* Ensure `text_files` is not null.
*
* When Drupal initializes it, it would give it null, despite being not
* null. Giving it an empty map seems to do the trick.
*/
function islandora_hocr_post_update_ensure_field_type_has_empty_map() {
$config = \Drupal::configFactory()->getEditable('search_api_solr.solr_field_type.islandora_hocr_und_7_0_0');
$value = $config->get('text_files');
if ($value === NULL) {
$config->set('text_files', [])
->save(TRUE);
}
}