Commit 6dfef84f authored by damjan's avatar damjan

[TASK] Removing un necessary exception conditions

There is no error possibility if XLF body tag is empty.
Exception appears only if there is no body tag at all in the xlf file.
parent b0ad83e6
......@@ -75,19 +75,13 @@ class FileBaseXLFService extends FileBaseService {
if (!is_file($file)) {
throw new LFException('failure.select.noLangfile');
}
/** @var ConfigurationService $configurationService */
$configurationService = $this->objectManager->get('SGalinski\Lfeditor\Service\ConfigurationService');
$extConfig = $configurationService->getExtConfig();
// read xml into array
$xmlContent = simplexml_load_file($file);
$xmlContent = json_decode(json_encode($xmlContent), TRUE);
// check data
if ((!is_array($xmlContent['file']['body']) || !count($xmlContent['file']['body']))
&& get_class($this) !== 'SGalinski\Lfeditor\Service\FileOverrideService'
&& 'en' === $extConfig['defaultLanguage']
) {
if (!is_array($xmlContent['file']['body'])) {
throw new LFException('failure.search.noFileContent', 0, '(' . $file . ')');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment