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..

Dear Community, we are currently using the `cms-block-storage` module 1.2.1 and I want to update th

UM4BZSK7T
UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet
edited May 2020 in Help

Dear Community,

we are currently using the cms-block-storage module 1.2.1 and I want to update this to it's latest 2.1.0 version as we need that version because it will update a block in all stores and all their languages and not just in the languages of the current store.

I am exactly talking about

\Spryker\Zed\CmsStorage\Business\Storage\CmsPageStorageWriter::getLocaleNameMapByStoreName

which before was done by just calling $localeNames = $this->store->getLocales();

Updating that one module ended up in updateing a lot more:
β€’ "spryker-shop/cms-block-widget": "~1.0.1" to "~2.1.0"
β€’ "spryker/cms-block": "2.1.1" to "~3.0.2"
β€’ "spryker/cms-block-category-connector": "~2.1.5" to "~2.3.0"
β€’ "spryker/cms-block-category-storage": "~1.2.1" to "~1.4.2"
β€’ "spryker/cms-block-gui": "~2.1.1" to "~2.4.0"
β€’ "spryker/cms-block-product-connector": "~1.1.4" to "~1.3.0"
β€’ "spryker/cms-block-product-storage": "~1.2.1" to "~1.4.1"
β€’ "spryker/cms-block-storage": "~1.2.1" to "~2.1.0"
β€’ "spryker/product": "~6.7.0" to "~6.12.0"
I use "~" because Spryker will break if you use "^" and do a composer update.

One thing that makes me uneasy is that this will increase spryker/product by 5 minor versions as the spryker/cms-block-product-connector has a hard dependency here.

Still that didn't break our system. What did break our system is the deprecation and final removal of CmsTwigFunctionServiceProvider() and CmsBlockTwigFunctionServiceProvider().

So now those two are CmsTwigPlugin() and CmsBlockTwigPlugin() and those won't belong into registerServiceProviders() providers anymore.

Sadly I now don't know what to do as it seems the YvesBootstrap did change. If I take a look at the current YvesBootstrapk in the spryker-shop/b2b-demo-shop it doesn't tell me where to register those plugins now.

All in all this means there is a BC break inside of those modules as the don't seem to run with our older application stack now.

To me it seems there are now 2 Versions of Spryker and at some point you have to do the transition from the old one to the new. And there is no feature update for the old API versions of the modules.

I would be happy about any suggestion.

Comments

  • Jeremy Fourna
    Jeremy Fourna Lead Product Manager Posts: 130 πŸ§‘πŸ»β€πŸš€ - Cadet
  • Hi Karsten, it sounds to me like you need support from one of our integration guides. I don't know if I fully understand your issue but this might be able to help you: https://documentation.spryker.com/v2/docs/cms-block-widget-integration-201903

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    Sorry don't know what do to with that guide. I am writing about composer update and all in all I believe Spryker now has at least 2 different version of to intergrate things. So it doesn't help me to know the new integration path except that we won't get any fitting updates anymore for our spryker version and have to integrate everything a new.

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    The TwigPlugins has to be registered in src/Pyz/Yves/Twig/TwigDependencyProvider.php now

    protected function getTwigPlugins(): array
    
  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    Thanks πŸ™‚ and everything else works the same? Is there a migration guide? I believe I didn't find information about this

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    I started to upgrade every package from some of the first versions to the latest ones. I use the migration guides provided by spryker https://documentation.spryker.com/docs/mg-cms

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hey Karsten, the fact that minor update has broken your shop by removing plugins is sad.. The upgrade guide is described here: https://documentation.spryker.com/docs/updating-a-spryker-based-project

    Minor updates can cause troubles, especially for overwritten classes. In this case - automated tests are your best friend. Iteratively updating modules and running tests and tools (also phpstan is helpful, too) - is the best way.

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    and yes, sometimes a major update can cause cascading updates of other modules. Probably you could first update them (after you know which already) + running the tests, and then updating to the major version

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    Dear @UKJSE6T47 this is exactly what I am doing and you can ask Valerii about how many times I told him the provided composer versions just won't match. In this case I am just puzzled that it seems we are the only ones with this kind of problem or nobody else dares to ask. Anyways.

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    As I wrote above I need to replace CmsTwigFunctionServiceProvider() and CmsBlockTwigFunctionServiceProvider(). as they are depricated.

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    So I need to register CmsTwigPlugin() and CmsBlockTwigPlugin()

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    Those those are TwigPluginInterface and https://documentation.spryker.com/docs/twig-and-twig-extension states how to do that.

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    So I guess from your docs that I now have to add to Yves TwigDependencyProvider for Cms and CmsBlock and include the cores TwigPlugins there?

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    As far as I can guess I should find that configuration in the b2b suite example. But there is nothing. So where do I register those plugins.

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    Is there any upgrade guide since the old Providers are now depricated? I couldn't find one.

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    CmsTwigPlugin and CmsBlockTwigPlugin has to be registered in src/Pyz/Yves/Twig/TwigDependencyProvider.php

    /**
     * @return \Spryker\Shared\TwigExtension\Dependency\Plugin\TwigPluginInterface[]
     */
    protected function getTwigPlugins(): array
    {
        return [
            ...
            new CmsBlockTwigPlugin(),
            new CmsContentWidgetTwigPlugin(),
            new CmsTwigPlugin(),
            ...
        ];
    }
    

    https://github.com/spryker-shop/suite/blob/master/src/Pyz/Yves/Twig/TwigDependencyProvider.php#L71
    or what is ur question?

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    @UM4BZSK7T very interesting case. The 1.2.1 version for cms-block-storage is 1 y.o, and the plugins you’re missing are part of Silex migration effort, the twig part (I just searched for CmsContentWidgetTwigPlugin in documentation): https://documentation.spryker.com/docs/migration-guide-twig and also https://documentation.spryker.com/docs/cms-feature-integration-guide. Have you done the β€œsilex migration” already? I want to figure out which dependency is missing..

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    what’s your spryker/application version?

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020
    3.18.1
    
  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    All out installed packeages so there are no questions πŸ˜‰ This is our update branch so I already updated the cms-block related packages.

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    hm, that’s very interesting. So you do have silex migrated. And the use of TwigDependencyProvider and plugins are there https://documentation.spryker.com/docs/cms-feature-integration-guide#4--set-up-widgets
    I believe you had a valid update path in your project that eventually lead you to the current situation, but it’s hard to trace it down to figure out at which step there were dependencies or instructions missing.. Good that you figured everything out πŸ‘

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    I will go through all the migration guids. As we are missing the TwigDependencyProvider there are some serious things missing I guess.

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    Oh and thanks a lot ❀ πŸ˜„

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    no problem! Sometimes you can even find the related migration guides by searching for a specific class name

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    I am going through https://documentation.spryker.com/docs/migration-guide-twig Bsically is all connected now but I would say that the spryker/twig composer.json is missing tons of dependencies. For example the trans() function will not not be recognized anymore as it would be added by

    TranslatorTwigPlugin
    

    Still we do use a much older version and as you can see in this commit https://github.com/spryker/translator/commit/63ec16ec39320cb0557e16a316e8966e5e7de164 the Twig Plugin was added end of July of 2019. So again I say there are basically 2 versions of spryker. Before plugin stacks and the later. But neither the migration guides or the composer files give a hint. The newer Twig version is bound to a later version of spryker/tranlate and there are like 15 more plugins I am currently missing an I have no clue what it means to pull them in our Spryker stack.

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    I would be really happy if you deprecate every thing older then XY or update the composer.json files so they are reliable. I am aware that updating all like 750 Spryker packages is hell and you have probably no interest to do that in the older versions. But please consider to do this in the future so this can't happen again.

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    Karsten, thanks for your feedback! We will look into the twig module - maybe we will find a pattern that we could apply to other modules or spot other missing dependencies. And yes, as you noticed already, maintaining/fixing now dependencies for all majors of all modules is time consuming πŸ™‚ however, our team develops more and more tools that help us not to miss such things in future. Such feedbacks are a huge help in developing them, thank you a lot!