From c92c639f3bf7cc8332cbe8537dd5d3b1edb131a1 Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Sat, 19 Oct 2024 10:09:08 +0200 Subject: [PATCH] Settings are always lowercase, so we have to lowercase the string we check --- lib/Service/ObjectService.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Service/ObjectService.php b/lib/Service/ObjectService.php index b1e55e95..eae59e1d 100644 --- a/lib/Service/ObjectService.php +++ b/lib/Service/ObjectService.php @@ -75,8 +75,10 @@ public function __construct( */ private function getMapper(string $objectType): mixed { + $objectTypeLower = strtolower($objectType); + // Get the source for the object type from the configuration - $source = $this->config->getValueString($this->appName, $objectType . '_source', 'internal'); + $source = $this->config->getValueString($this->appName, $objectTypeLower . '_source', 'internal'); // If the source is 'open_registers', use the OpenRegister service if ($source === 'openregister') { @@ -84,11 +86,11 @@ private function getMapper(string $objectType): mixed if ($openRegister === null) { throw new Exception("OpenRegister service not available"); } - $register = $this->config->getValueString($this->appName, $objectType . '_register', ''); + $register = $this->config->getValueString($this->appName, $objectTypeLower . '_register', ''); if (empty($register)) { throw new Exception("Register not configured for $objectType"); } - $schema = $this->config->getValueString($this->appName, $objectType . '_schema', ''); + $schema = $this->config->getValueString($this->appName, $objectTypeLower . '_schema', ''); if (empty($schema)) { throw new Exception("Schema not configured for $objectType"); }