diff --git a/application/libraries/FehlerUpdateLib.php b/application/libraries/FehlerUpdateLib.php index a969bffba..5eca64f76 100644 --- a/application/libraries/FehlerUpdateLib.php +++ b/application/libraries/FehlerUpdateLib.php @@ -59,8 +59,9 @@ class FehlerUpdateLib // Loads EPrintfLib $this->_ci->load->library('EPrintfLib'); - // Loads the PhraseModel + // Loads the Models $this->_ci->load->model('system/Fehler_model', 'FehlerModel'); + $this->_ci->load->model('system/App_model', 'AppModel'); } // ----------------------------------------------------------------------------------------------------------------- @@ -93,7 +94,6 @@ class FehlerUpdateLib $this->installFrom($configFilePath); } } - } /** @@ -207,23 +207,23 @@ class FehlerUpdateLib // no fehler has been found - // hanlde apps + // handle apps if (isset($fehler[self::APP])) { $apps = $fehler[self::APP]; if (is_string($apps)) $apps = [$apps]; - //unset($fehler[self::APP]); + + foreach ($apps as $app) + { + // check if app exists in db + $this->_ci->AppModel->addSelect('1'); + $appRes = $this->_ci->AppModel->loadWhere(['app' => $app]); + + if (!hasData($appRes)) return error("App ".$app." does not exist"); + // TODO add entry for each app + } + $fehler[self::APP] = $apps[0]; - - //~ foreach ($apps as $app) - //~ { - //~ // TODO add entry for each app - //~ foreach ($_ as $_) - //~ { - - //~ } - - //~ } } // Then add the fehler to the database diff --git a/application/libraries/issues/PlausicheckProducerLib.php b/application/libraries/issues/PlausicheckProducerLib.php index 0cd76962a..34807c917 100644 --- a/application/libraries/issues/PlausicheckProducerLib.php +++ b/application/libraries/issues/PlausicheckProducerLib.php @@ -144,6 +144,7 @@ class PlausicheckProducerLib $result = new StdClass(); $result->errors = []; $result->infos = []; + $mappingFehlerKurbz = array_keys($this->_fehlerLibMappings); // check if all issues to produce could be found in database diff --git a/application/libraries/issues/PlausicheckResolverLib.php b/application/libraries/issues/PlausicheckResolverLib.php index 89b68a7b8..06c3705a3 100644 --- a/application/libraries/issues/PlausicheckResolverLib.php +++ b/application/libraries/issues/PlausicheckResolverLib.php @@ -161,7 +161,7 @@ class PlausicheckResolverLib if (isset($this->_codeLibMappings[$issue->fehlercode])) { $codeLibMapping = $this->_codeLibMappings[$issue->fehlercode]; - $libName = $codeLibMapping[self::RESOLVER_LIB_NAME]; + $libName = $codeLibMapping[self::RESOLVER_LIB_NAME] ?? null; $extensionName = $codeLibMapping[self::EXTENSION_NAME] ?? null; $producerIsResolver = $codeLibMapping[self::PRODUCER_IS_RESOLVER_NAME] ?? false; diff --git a/application/models/system/App_model.php b/application/models/system/App_model.php new file mode 100644 index 000000000..85d015f42 --- /dev/null +++ b/application/models/system/App_model.php @@ -0,0 +1,14 @@ +dbTable = 'system.tbl_app'; + $this->pk = 'app'; + } +}