yireo / magento2-replace-all

Meta-package to replace all optional Magento 2 modules
129 stars 33 forks source link

Magento 2.4.3 replace-all issue #23

Closed teodorpav closed 3 years ago

teodorpav commented 3 years ago

Hi, on M 2.4.3 and after apply replace-all , the bin/magento commands not working:

myshop@server:public_html]$ bin/magento cache:flush There are no commands defined in the "cache" namespace.

[myshop@server:public_html]$ bin/magento setup:upgrade There are no commands defined in the "setup" namespace.

How to fix this?

Thank you

avstudnitz commented 3 years ago

Please run bin/magento without any parameters - it should give you a real error message. Most probably this error has nothing to do with this package and can in many cases be fixed by clearing generated/code and var/cache.

teodorpav commented 3 years ago

Hi, it shows:

[myshop@server:public_html]$ bin/magento list Magento CLI 2.4.3

Usage: command [options] [arguments]

Options: -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands: help Display help for a command list List commands

In ServiceManager.php line 652: Service with name "Magento\Setup\Console\Command\DbStatusCommand" could not be created. Reason: Class Vertex\Tax\Setup\Schema\Triggers\MigrateVertexInv
oiceSent does not exist

In ClassReader.php line 28: Class Vertex\Tax\Setup\Schema\Triggers\MigrateVertexInvoiceSent does not exist

jissereitsma commented 3 years ago

Could you confirm that all packages from vendor/vertex are gone? If not, which package is still there?

teodorpav commented 3 years ago

Hi, i've removed all vendor/vertex but now there is an error during the compilation:

[myshop@server:public_html]$ bin/magento setup:di:compile Compilation was started. Repositories code generation... 1/9 [===>------------------------] 11% < 1 sec 88.0 MiBInterface 'Magento\InventoryCatalogSearch\Model\Indexer\SelectModifierInterface' not found#0 /home/myshop/public_html/vendor/composer/ClassLoader.php(480): include()

1 /home/myshop/public_html/vendor/composer/ClassLoader.php(346): Composer\Autoload\includeFile('/home/myshop/pu...')

2 [internal function]: Composer\Autoload\ClassLoader->loadClass('Magento\Invento...')

3 [internal function]: spl_autoload_call('Magento\Invento...')

4 /home/myshop/public_html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(134): class_exists('Magento\Invento...')

5 /home/myshop/public_html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(117): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->includeClass('Magento\Invento...', '/home/myshop/pu...')

6 /home/myshop/public_html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(87): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->extract(Object(RecursiveIteratorIterator))

7 /home/myshop/public_html/setup/src/Magento/Setup/Module/Di/App/Task/Operation/RepositoryGenerator.php(61): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->getList('/home/myshop/pu...')

8 /home/myshop/public_html/setup/src/Magento/Setup/Module/Di/App/Task/Manager.php(56): Magento\Setup\Module\Di\App\Task\Operation\RepositoryGenerator->doOperation()

9 /home/myshop/public_html/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php(216): Magento\Setup\Module\Di\App\Task\Manager->process(Object(Closure), Object(Closure))

10 /home/myshop/public_html/vendor/symfony/console/Command/Command.php(255): Magento\Setup\Console\Command\DiCompileCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

11 /home/myshop/public_html/vendor/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

12 /home/myshop/public_html/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Magento\Setup\Console\Command\DiCompileCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

13 /home/myshop/public_html/vendor/magento/framework/Console/Cli.php(115): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

14 /home/myshop/public_html/vendor/symfony/console/Application.php(149): Magento\Framework\Console\Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

15 /home/myshop/public_html/bin/magento(23): Symfony\Component\Console\Application->run()

16 {main}

jissereitsma commented 3 years ago

But which packages did you remove? See my earlier reply: "If not, which package is still there?"

The error sounds like a normal Magento issue. If you make huge changes to the vendor/ folder, wipe out the cache, wipe out the generated folder and try again.

Could you confirm how you added the replace-all package and which version you are using of that package?

teodorpav commented 3 years ago

When I had problems with bin/magento commands after yireo/magento2-replace-all , I installed "yireo/magento2-replace-bundled": "^4.3", "yireo/magento2-replace-content-staging": "^4.2", "yireo/magento2-replace-inventory": "^4.2", "yireo/magento2-replace-sample-data": "^4.2" and everything was OK. But I want to use magento2-replace-all to remove all unnecessary things.

Before install with the command : composer require yireo/magento2-replace-all and it is installed 4.2.3 version. Clear all cache and rm -rf var/di/ generated/ var/cache/ var/page_cache/ var/view_preprocessed/ pub/static/ and the error in compile is still there: [myshop@server:public_html]$ bin/magento setup:di:compile Compilation was started. Repositories code generation... 1/9 [===>------------------------] 11% < 1 sec 88.0 MiBInterface 'Magento\InventoryCatalogSearch\Model\Indexer\SelectModifierInterface' not found#0 /home/myshop/public_html/vendor/composer/ClassLoader.php(480):

Thank you

jissereitsma commented 3 years ago

There seemed to be still issues, but I've not encountered the issue you reported (yet). Could you try out 4.2.5 instead? https://github.com/yireo/magento2-replace-all/releases/tag/4.2.5

teodorpav commented 3 years ago

Hi, it is passed the first part but now stoped on the 5. Maybe some conflict with Mirasvit GraphQl

[myshop@server:public_html]$ bin/magento setup:di:compile Compilation was started. Area configuration aggregation... 5/9 [===============>------------] 55% 23 secs 262.0 MiB In ClassReader.php line 51: Impossible to process constructor argument Parameter #0 [ Magento\CatalogGraphQl\Model\AttributesJoiner $attributesJoiner ] of Mirasvit\SearchGraphQl\Model\Resolver\Magento\Catalog\Product class
In ClassReader.php line 71: Class Magento\CatalogGraphQl\Model\AttributesJoiner does not exist

The error is there even bin/magento mo:di Mirasvit_SearchGraphQl module is disabled.

Any ideas?

Thank you

jissereitsma commented 3 years ago

Yes, but this is the kind of troubleshooting you need to do yourself, when trying to replace core packages. Simple suggestion: Replace those other third party extensions as well. Or reconsider the removal of all packages :)

I'm closing the ticket for now, because there no longer seems to be an issue with the replacements of this package.