madeyourday / contao-rocksolid-custom-elements

RockSolid Custom Elements Contao Extension
http://rocksolidthemes.com/de/contao/plugins/custom-content-elements
MIT License
48 stars 12 forks source link

Installation fails in CustomElements::loadConfig() #77

Closed m-vo closed 7 years ago

m-vo commented 7 years ago

Installing via composer fails on windows and leads to the following errors (each one multiple times): PHP Warning: mkdir(): No such file or directory in X:\path\to\contao\vendor\contao\core-bundle\src\Resources\contao\library\Contao\Files.php on line 87

Warning: rename(X:\Path\to\contao/system/tmp/16cecb56e6c2a94ab589ec1249d1ac92,X:\path\to\contao/X:\path\to\contao\var\cache\pro_/contao/rocksolid_custom_elements_config.php): Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch. (code: 123) in X:\path\to\contao\vendor\contao\core-bundle\src\Resources\contao\library\Contao\Files.php on line 217

Looks like the filepath does not get set up correctly (relative?). What's that second boolean argument for when constructing the File() btw? The constructor only has one argument.

Example stack trace excerpt for the first one (they both originate in loadConfig() > $file->close();):

[...]

MadeYourDay\RockSolidCustomElements\CustomElements::loadConfig() 
...\vendor\madeyourday\contao-rocksolid-custom-elements\src\CustomElements.php:1298

Contao\File->close() 
...\vendor\madeyourday\contao-rocksolid-custom-elements\src\CustomElements.php:1222

Contao\Folder->__construct() 
...\vendor\contao\core-bundle\src\Resources\contao\library\Contao\File.php:567

Contao\Files->mkdir() 
...\vendor\contao\core-bundle\src\Resources\contao\library\Contao\Folder.php:95

mkdir() 
...\vendor\contao\core-bundle\src\Resources\contao\library\Contao\Files.php:87

Contao 4.3.9 PHP 7.1 | Windows 10

ausi commented 7 years ago

Could you please try to add the following code before line 1222 in vendor\madeyourday\contao-rocksolid-custom-elements\src\CustomElements.php:

var_export([
    'filePaths' => $filePaths,
    'root' => TL_ROOT,
    'self' => __FILE__,
]);
exit;

and post here what is shown in the Contao backend after that change?

What's that second boolean argument for when constructing the File() btw? The constructor only has one argument.

This argument was needed in Contao 3, see contao/core system/modules/core/library/Contao/File.php:128.

m-vo commented 7 years ago

here it goes:

array ( 'filePaths' => array ( 'path' => 'X:\\path\\to\\contao\\var\\cache\\prod/contao/rocksolid_custom_elements_config.php', 'fullPath' => 'X:\\path\\to\\contao\\var\\cache\\prod/contao/rocksolid_custom_elements_config.php', ), 'root' => 'X:\\path\\to\\contao', 'self' => 'X:\\path\\to\\contao\\vendor\\madeyourday\\contao-rocksolid-custom-elements\\src\\CustomElements.php', )
ausi commented 7 years ago

Thanks for reporting this bug! Should be fixed in the latest version 2.0.1. If not, please reopen this issue.

m-vo commented 7 years ago

👍 Works, thanks for fixing it.