What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hello all, I have added (copy/pasted) a module in spryker-eco folder but its classes are not being l
Hello all, I have added (copy/pasted) a module in spryker-eco folder but its classes are not being loaded in Zed. Can someone please tell me what I might be missing?
Comments
-
namespaces? cache? (
cache:class-resolver:build
)0 -
@UNGMX0012 Can you please elaborate on namespaces?
I am trying to access some constants in default_config file like this:
use SprykerEco\Shared\AkeneoPim\AkeneoPimConstants; ... $config[AkeneoPimConstants::HOST] = '[abc.cloud.akeneo.com](http://abc.cloud.akeneo.com)'; $config[AkeneoPimConstants::USERNAME] = 'ab2344'; ...
After this, when I run console cache:class-resolver:build, I get:
PHP Fatal error: Uncaught Error: Class "SprykerEco\Shared\AkeneoPim\AkeneoPimConstants" not found in /data/config/Shared/config_default.php:133
0 -
This is what I have in the vendor directory
0 -
@U048WDEP3R7 can you check, if the module is there inside of the docker container? e.g. execute docker/sdk cli ls -la vendor/spryker-eco
0 -
it seems to be an autoloading issue, so if it is actually present, you can try to rebuild the composer autoloader with: docker/sdk cli composer dump-autoload
0 -
and if you have not done so anyway, I would recommend executing composer inside of the docker container, when you install modules. with docker/sdk cli composer require spryker/eco-... (instead of running it locally)
0 -
@U01BZ7Q3XRV thanks for pointing that out. I just checked and it is there. I also did dump-autoload from the CLI
0 -
@U01BZ7Q3XRV I manually copy/pasted these modules in the spryker-eco folder. Does this make a difference?
0 -
ah, yes it does. because the composer installation process does more then just copying the files. So if the dump-autoload command did not work, this is probably because composer is not aware that the module exists in your directory, and so the autoload file is not genreated for this module
0 -
so in theory, if you remove the directory again, and then install it with docker/sdk cli composer require spryker-eco/akeneo-pim-middleware-connector it should work
0 -
in case you do not get any version conflicts
0 -
@U01BZ7Q3XRV I actually copy pasted them because I was getting version conflicts with composer. Is there a workaround?
0 -
you can try adding the "update with dependencies" flag to the composer require command. first with "-w" and if that does not work with "-W" (in capital)
0 -
it will try to update the required dependencies. There might still be errors, then you have to manually check the modules, that are throwing errors, I guess.
0 -
@U01BZ7Q3XRV I actually tried the modules require PHP 7.3 where as I am using 8. So they can not get installed via composer. This is why I manually downloaded the source code. Can you please tell me what can we do to manually integrate the modules from Spryker-Eco? Or maybe I should create copies, rename the namespaces to custom namespace and then use them directly in Zed etc?
0 -
yes, I fear then the module is just too outdated for a newer spryker installation. You can try to move it to your project namespace, yes. In that case you can keep the SprykerEco namespace (so put it under src/SprykerEco) I think to have it a bit separated from your actual project code. Or of course you can also migrate it to your porject namespace. If you use the SprykerEco namespace, you just have to make sure, that in your config/Shared/config_default.php SprykerEco is included in the namespaces:
$config[KernelConstants::CORE_NAMESPACES]
But it should be there already, I think
0 -
I think then it should work to just copy the contents of vendor/.../.../src/SprykerEco to src/SprykerEco
0 -
ah, one more thing, you probably then also have to add SprykerEco to
$config[KernelConstants::PROJECT_NAMESPACES]
in your config_default.php
0 -
then the spryker autoloader should be able to locate them
0 -
Thanks @U01BZ7Q3XRV. This helps a lot.
0 -
suer π no problem
0 -
Hi, I've just finished Akeneo PIM installation. I've installed akeneo-pim-middleware package with composer - there is no PHP 8 compatible package, but on GH is fix, so I downloaded it on hard drive and install with composer locally.
According to the documentation https://docs.spryker.com/docs/pbc/all/product-information-management/202212.0/third-party-integrations/akeneo/akeneo-console-commands.html this console commands should works as OOTB, but i get only exception :Error - Exception: Call to undefined method SprykerEco\Zed\AkeneoPimMiddlewareConnector\Communication\Plugin\Configuration\SuperAttributeImportConfigurationPlugin::getProcessConfigurationPlugins()
in /data/vendor/spryker-middleware/process/src/SprykerMiddleware/Zed/Process/Business/PluginResolver/ProcessPluginResolver.php (32)
I try, just for a testing purpose, put this undefined method to SuperAttributeImportConfigurationPlugin. Result is that, I get new not found exception:
Spryker\Zed\Kernel\Exception\Container\ContainerKeyNotFoundException - Exception: Spryker Kernel Exception
Container does not contain the called "AKENEO_PIM_MIDDLEWARE_CATEGORY_IMPORTER_PLUGIN"
You can fix this by adding the key "AKENEO_PIM_MIDDLEWARE_CATEGORY_IMPORTER_PLUGIN" to your "AkeneoPimMiddlewareConnectorDependencyProvider"
in /data/vendor/spryker/kernel/src/Spryker/Zed/Kernel/BundleDependencyProviderResolverAwareTrait.php (51)
However"AKENEO_PIM_MIDDLEWARE_CATEGORY_IMPORTER_PLUGIN"
exists in"AkeneoPimMiddlewareConnectorDependencyProvider"
so I don't know where problem is.0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random