moosh icon indicating copy to clipboard operation
moosh copied to clipboard

fix: config-plugin-import builds additional file paths incorrectly

Open maxandron opened this issue 2 years ago • 2 comments

Explained in this issue: https://github.com/tmuras/moosh/issues/456

$this->inputfilepath contains the entire path

while $setting->getAttribute('file') contains the hash

maxandron avatar Nov 20 '23 06:11 maxandron

This is inside the code: if ($setting->hasAttribute('file')) {

I think this code is there to import another file, that is referenced in the settings - and not the xml itself.

tmuras avatar Nov 20 '23 08:11 tmuras

Aah, yes, I see. The setting in question is

<setting name="favicon" file="f00c6f0664dbd9dd6744c7497b8a164014072560">/logo.ico</setting>

I understand now that the logo.ico was already imported (via the loop in line 88 by parsing the files.json file).

Then the solution can be simply removing the if ($setting->hasAttribute('file')) { block perhaps?

Also something worth noting - the export function creates a tar archive that is not used by the import process

maxandron avatar Nov 20 '23 09:11 maxandron