Skip to content

Commit a4b8b85

Browse files
Define stub Blender2Mappings.yaml that inherits from Blender1 mappings.
1 parent f1d5105 commit a4b8b85

File tree

6 files changed

+25
-10
lines changed

6 files changed

+25
-10
lines changed

config/vufind/Blender.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ blockSize = 7
3030
;adaptiveBlockSizes[] = "0-20:3"
3131
;adaptiveBlockSizes[] = "21-10000:5"
3232

33-
; Mappings configuration filename. Omit the ".yaml" extension.
34-
mappings = BlenderMappings
35-
3633
; ---------- config.ini settings ----------
3734

3835
[Record]

config/vufind/Blender2.ini

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
; This configuration file can be used to set up a secondary Blender, i.e. to
22
; combine a different set of backends. This instance is accessible under /Blender2
3-
; URLs within VuFind.
4-
;
5-
; Note that BlenderMappings.yaml is still used by this secondary Blender, unless
6-
; otherwise specified in "mappings" below.
3+
; URLs within VuFind. See also Blender2Mappings.yaml.
74
;
85
; All of the settings are copied from Blender.ini. To ease maintenance of
96
; documentation, comments from that file are not duplicated here. See Blender.ini
@@ -31,8 +28,6 @@ blockSize = 7
3128
;adaptiveBlockSizes[] = "0-20:3"
3229
;adaptiveBlockSizes[] = "21-10000:5"
3330

34-
mappings = BlenderMappings
35-
3631
; ---------- config.ini settings ----------
3732

3833
[Record]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This is the Blender mappings configuration for the backend configured in Blender2.ini.
2+
# Blender2-specific rules can be defined below.
3+
4+
# By default, Blender2 inherits rules from the parent configuration. Disable this line
5+
# to not inherit those rules. Only sections not found in this file will be loaded in
6+
# from the parent file.
7+
"@parent_config_name": "BlenderMappings"
8+

module/VuFind/src/VuFind/Search/Blender/ParamsFactory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ public function __invoke(
9292
if (!$backendConfig) {
9393
throw new \Exception('No backends enabled in ' . $this->blenderIni . '.ini');
9494
}
95-
$this->blenderMappingsYaml = $blenderConfig->Blending->mappings ?? $this->blenderMappingsYaml;
9695

9796
$facetHelper
9897
= $container->get(\VuFind\Search\Solr\HierarchicalFacetHelper::class);

module/VuFind/src/VuFind/Search/Blender2/ParamsFactory.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,13 @@ class ParamsFactory extends \VuFind\Search\Blender\ParamsFactory
4848
* @var string
4949
*/
5050
protected $blenderIni = 'Blender2';
51+
52+
/**
53+
* Configuration file to read Blender mappings settings from
54+
*
55+
* Note that any change to this must be made before calling the constructor of this class.
56+
*
57+
* @var string
58+
*/
59+
protected $blenderMappingsYaml = 'Blender2Mappings';
5160
}

module/VuFind/src/VuFind/Search/Factory/Blender2BackendFactory.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,11 @@ class Blender2BackendFactory extends BlenderBackendFactory
5353
* @var string
5454
*/
5555
protected $facetConfig = 'Blender2';
56+
57+
/**
58+
* Mappings YAML configuration file identifier.
59+
*
60+
* @var string
61+
*/
62+
protected $mappingsConfig = 'Blender2Mappings';
5663
}

0 commit comments

Comments
 (0)