Skip to content

Commit

Permalink
Merge pull request #9 from discoverygarden/fix/configs
Browse files Browse the repository at this point in the history
CTDA9-404: Avoid warning
  • Loading branch information
nchiasson-dgi committed Aug 15, 2023
2 parents 02b49ae + dc922a1 commit a4c1f9a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
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);
}
}

0 comments on commit a4c1f9a

Please sign in to comment.