Skip to content

Commit

Permalink
read schemadb path from config
Browse files Browse the repository at this point in the history
  • Loading branch information
flack committed Jun 27, 2024
1 parent 69958c1 commit d88402b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lib/midcom/helper/search/config/config.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
* may not get matched since the wildcard part matches nothing)
*/
'single_term_auto_wildcard' => false,

'schemadb_config' => 'file:/midcom/helper/search/config/config_schemadb.inc',
6 changes: 2 additions & 4 deletions lib/midgard/admin/asgard/schemadb/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@ public function __construct(string $component, midcom_helper_configuration $conf
public function create() : schemadb
{
// Load SchemaDb
$schemadb_config_path = midcom::get()->componentloader->path_to_snippetpath($this->component) . '/config/config_schemadb.inc';
$schemaname = 'default';

if (file_exists($schemadb_config_path)) {
$schemadb = schemadb::from_path('file:/' . str_replace('.', '/', $this->component) . '/config/config_schemadb.inc');
if ($path = $this->config->get('schemadb_config')) {
$schemadb = schemadb::from_path($path);
if ($schemadb->has('config')) {
$schemaname = 'config';
}
// TODO: Log error on deprecated config schema?
} else {
// Create dummy schema. Naughty component would not provide config schema.
$schemadb = new schemadb(['default' => [
Expand Down

0 comments on commit d88402b

Please sign in to comment.