FACT-Finder-Web-Components / shopware6-plugin

FACT-Finder® Web Components for Shopware 6
Other
3 stars 6 forks source link

Type Error for Return Value of UploadService in v2.2.0 #68

Closed sebastianmorgenstern closed 3 years ago

sebastianmorgenstern commented 3 years ago

If the Uploadservice has to create the export directory, the command returns a type error for the return value as the createExportDirectory function does not have a return statement.

Error:

In UploadService.php line 70:

 Return value of Omikron\FactFinder\Shopware6\Upload\UploadService::createExportDirectory() must be of the type bool, none returned

Function:

private function createExportDirectory(FilesystemInterface $filesystem): bool
    {
        $result = $filesystem->createDir('export');
        if (!$result) {
            throw new Exception('Failed to create "export directory"');
        }
    }
a-laurowski commented 3 years ago

Hi @sebastianmorgenstern and thanks for reporting that We are on it

a-laurowski commented 3 years ago

@sebastianmorgenstern the pr is out. Function checking directory existence has been removed. Instead, new field in config has been added where user manually set the root path.

a-laurowski commented 3 years ago

@sebastianmorgenstern there is a new pre-release v2.2.1 which contains the fix. Can i ask you to confirm that with this version, upload is working for you?

sebastianmorgenstern commented 3 years ago

@a-laurowski

I will come back to you when i was able to deploy the new version. As v2.2.1 fixes in addition our problem with the search-immediate param, this will be most likely today.

The changes in the Uploadservice looks good for me, as v2.2.0 has created an export folder on the ftp server and was just failing after that. The the connection should be fine.

sebastianmorgenstern commented 3 years ago

@a-laurowski

The Upload works now. I will therefor close this one. Thank you for the fast reaction. (but there is another issue, you have set 21 as default value in the root filed of the config. This leads to new exception when this value is not manually reset, i will open a new issue for this one)