Skip to content

Error message during XML import if format version is wrong is not shown #40

@noeol

Description

@noeol

l10nmgr Version: 11.2.0
TYPO3: 11.5.34
PHP Version: 7.4

Error: If the format version of the XML import file does not correspond to the required version, no error message is shown. The user can therefore not recognize what the problem is when trying to import an old XML format version (e.g. 1.2 from l10nmgr v9.2 created under TYPO3 v9.5) .

How to reproduce: Simply change the version from 2.0 to 1.2 in the XML file (see <t3_formatVersion>) and try to import it.

Current state How it should be
Current state How it should be

Suggestion how to fix the issue:

$this->languageService = GeneralUtility::makeInstance(LanguageService::class);

     public function __construct(string $file, int $sysLang, string $xmlString)
     {
         $this->sysLang = $sysLang;
-        $this->languageService = GeneralUtility::makeInstance(LanguageService::class);
+        $this->languageService = $GLOBALS['LANG'] ?? GeneralUtility::makeInstance(LanguageService::class);
         if (!empty($file)) {
             $this->file = $file;
         }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions