View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007120 | OXID eShop (all versions) | 2.3. Extensions (modules, themes) | public | 2020-04-17 12:35 | 2022-03-25 08:10 |
Reporter | ivoba | Assigned To | |||
Priority | urgent | Severity | block | Reproducibility | always |
Status | closed | Resolution | unable to reproduce | ||
Product Version | 6.2.0 | ||||
Summary | 0007120: Custom Module Command breaks composer update | ||||
Description | This is related to https://bugs.oxid-esales.com/view.php?id=7112 When creating your own command inside of a module, composer update fails with PHP Fatal error: Uncaught Error: Call to undefined method MyName\Importer\Commands\MyCommand::getDefaultName() in /var/www/html/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php:61 This happens only when in service.yaml command in tags is not defined: So this works: tags: - { name: 'console.command', command: 'my-name:my-module:my-command' } But this should work without having to define command again, double to inside of Command class. ->setName('my-name:my-module:my-command') Seems this is some symfony/console version mismatch with composer. | ||||
Tags | No tags attached. | ||||
Theme | Not defined | ||||
Browser | Not defined | ||||
PHP Version | Not defined | ||||
Database Version | Not defined | ||||
|
Thanks for your report. This issue was known from the update component. Looks like it triggers also in your mentioned case. I acknowledge it as a bug, but want to say, that it does not block from using the module/command. The error message will be displayed during composer update, but the whole process works anyway. [sp] |
|
I have to correct my note. Looks like we were lucky with the update component, but the error itself leads to a execution stop of the process. Therefore script won't be run and for example modules don't get copied or the module configuration won't be updated. This results in major issues. Priority increased. Please use the provided workaround: Adding the command to the services.yaml. [sp] |
|
I stumbled upon the same issue a few months ago, here's the reason: https://stackoverflow.com/a/61655652/2123108 |
|
Thank you for the report again! I was not able to reproduce the described issue. Could you please double-check if the issue is still in place, and if it is: * please try updating the composer to the latest version and try again * if still reproducible - could you please provide more information - the Shop/Compilation, php and composer-version you facing the issue on. |
|
QA also tried to reproduce again and were not able to do so. Tested with: - 6.4.1 + Composer 2 - 6.3.1 + Composer 2 - 6.3.1 + Composer 1 (this combination is actually not supported!) - 6.2.5 + Composer 2 - 6.2.4 + Composer 1 Used a simple OXID eShop Component without any extra entry about the command name in the services.yaml. The component adds an example console command. No issues encountered during installation, usage or uninstallation. Last test with OXID eShop 6.2.4 and Composer 1 also provides an (unexpected) positive result. Therefore any other requirement must be given to run into the error or the issue was fixed on a patch release of 6.2 back in the days. Further instructions needed to reproduce in 6.4.x/6.3.1 with Composer 2. Any other version is outdated and not part of the maintenance process anymore. If reproduceability is not given in these versions, the issue should be closed. [sp] |