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 am getting this error: `You need to implement `Spryker\Zed\Gui\Communication\Table\Abs
Hello all,
I am getting this error:You need to implement
Spryker\Zed\Gui\Communication\Table\AbstractTable::getCsvHeaders()in your
Spryker\Zed\Glossary\Communication\Table\TranslationTable.
Even though I have implemented this function inside Spryker\Zed\Glossary\Communication\Table\TranslationTable
Can some one please advise?
Comments
-
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
Hey, this sounds a bit strange:
Spryker\Zed\Glossary\Communication\Table\TranslationTable
should not be touched by you since it should be in the vendor-folder. What do you mean by “you have implemented this function” ?0 -
@florian.scholz I have extended this class inside my own directory like this:
<?php namespace Playground\Zed\Glossary\Communication\Table; use Spryker\Zed\Glossary\Communication\Table\TranslationTable as SprykerTranslationTable; class TranslationTable extends SprykerTranslationTable { /** * @var string */ public const COL_GLOSSARY_ID = 'spy_glossary_key.id_glossary_key'; /** * @var string */ public const COL_GLOSSARY_KEY = 'spy_glossary_key.key'; /** * @var string */ public const COL_GLOSSARY_EN_US = 'en_US'; /** * @var string */ public const COL_GLOSSARY_DE_DE = 'de_DE'; /** * @return array<string> */ protected function getCsvHeaders(): array { return [ static::COL_GLOSSARY_ID => '#', static::COL_GLOSSARY_KEY => 'Name', static::COL_GLOSSARY_EN_US => 'EN_US', static::COL_GLOSSARY_DE_DE => 'DE_DE', ]; } }
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
ahh ok, so it seems that your changed file is not loaded properly. Have you adjusted the right factory (in this case
GlossaryCommunicationFactory
) as you need to do for most of the files you extend on project level?0 -
@florian.scholz No I haven't adjusted the factory. So I also need to extend the factory in the same directory?
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
yes, actually this is pretty standard if you extend stuff on project level, one of crucial information you need to learn if you code in Spryker 🙂 But i guess now you will memorize for next time 💪
0 -
@florian.scholz thank you for your help 🙂
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
Maybe this free elearning could be also useful for you: https://academy.spryker.com/learn/course/external/view/elearning/481/project-customization
0 -
@florian.scholz So I am still getting the same error. Here is my directory structure and the code files. And I did add the project configurations in composer and config_default
<?php namespace Playground\Zed\Glossary\Communication\Table; use Spryker\Zed\Glossary\Communication\Table\TranslationTable as SprykerTranslationTable; class TranslationTable extends SprykerTranslationTable { /** * @var string */ public const COL_GLOSSARY_ID = 'spy_glossary_key.id_glossary_key'; /** * @var string */ public const COL_GLOSSARY_KEY = 'spy_glossary_key.key'; /** * @var string */ public const COL_GLOSSARY_EN_US = 'en_US'; /** * @var string */ public const COL_GLOSSARY_DE_DE = 'de_DE'; /** * @return array<string> */ protected function getCsvHeaders(): array { return [ static::COL_GLOSSARY_ID => '#', static::COL_GLOSSARY_KEY => 'Name', static::COL_GLOSSARY_EN_US => 'EN_US', static::COL_GLOSSARY_DE_DE => 'DE_DE', ]; } }
<?php namespace Playground\Zed\Glossary\Communication; use Spryker\Zed\Glossary\Communication\GlossaryCommunicationFactory as SprykerGlossaryCommunicationFactory; use Playground\Zed\Glossary\Communication\Table\TranslationTable; class GlossaryCommunicationFactory extends SprykerGlossaryCommunicationFactory { /** * @param array $locales * * @return \Spryker\Zed\Glossary\Communication\Table\TranslationTable */ public function createTranslationTable(array $locales) { $glossaryKeyQuery = $this->getQueryContainer() ->queryKeys(); $subQuery = $this->getQueryContainer() ->queryTranslations(); return new TranslationTable($glossaryKeyQuery, $subQuery, $locales); } }
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
Did any other file in your namespace “Playground” work so far? My guess is no
0 -
@florian.scholz, yes the Twig file in the Presentation folder is replacing the twig file in the vendor folder successfully
0 -
@florian.scholz It works now. There was some browser caching issue which was calling the old URL
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
ahh ok, so wrong guess of me 😛 Then you have already added that namespace to the config 💪 nice
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
glad it works now
0 -
@florian.scholz thanks again
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
if you override or remove Spryker autoloaded files (see files listed here https://docs.spryker.com/docs/scos/dev/architecture/code-buckets.html#logical-inheritance) you normally have to call the console class-resolver:build command
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