View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007118 | OXID eShop (all versions) | 4.07. Source code, Test | public | 2020-04-15 10:32 | 2024-07-03 13:21 |
Reporter | michael_keiluweit | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | confirmed | Resolution | open | ||
Product Version | 6.2.0 | ||||
Summary | 0007118: ProjectYamlDao::saveProjectConfigFile does not check if file is writeable | ||||
Description | When a module is activated which has a service.yaml in its directory, the module activation services will register it by calling the method ProjectYamlDao::saveProjectConfigFile \OxidEsales\EshopCommunity\Internal\Framework\Module\Setup\Service\ModuleActivationService::activate [...] \OxidEsales\EshopCommunity\Internal\Framework\DIContainer\Dao\ProjectYamlDao::saveProjectConfigFile The content of the method: public function saveProjectConfigFile(DIConfigWrapper $config) { if (!$this->filesystem->exists($this->getGeneratedServicesFileDirectory())) { $this->filesystem->mkdir($this->getGeneratedServicesFileDirectory()); } file_put_contents( $this->context->getGeneratedServicesFilePath(), Yaml::dump($config->getConfigAsArray(), 3, 2) ); } As you see the return value from file_put_contents isn't evaluated. If the rights of the directory or the file itself of /var/www/shop/var/generated/generated_services.yaml are not sufficient enough, the file will not be modified, the service not registered and the administrator gets this error message in the backend: OXID Logger.ERROR: You have requested a non-existent service "OxidEsales\GraphQL\Base\Framework\ModuleSetup". ["[object] (Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException(code: 0): You have requested a non-existent service \"OxidEsales\\GraphQL\\Base\\Framework\\ModuleSetup\". at /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php:1060) Which would let you think that the module is broken. But truly the folder permissions are wrong, which should be checked and handled by the shop framework. | ||||
Tags | DI, Exception, File Permissions, Module, Service | ||||
Theme | Not defined | ||||
Browser | Not defined | ||||
PHP Version | Not defined | ||||
Database Version | Not defined | ||||