DEV Community

Discussion on: Obstacles at the end of the tunnel: trying to finish my tutorial plugin

Collapse
 
ingosteinke profile image
Ingo Steinke • Edited

Update: updating without reinstallation must use the update command instead of install to retain existing data (see Joshi's StackOverflow post: How to update shopware 6 docker local setup while persisting existing data?

Updating locally:

cd development/platform
git pull
rm composer.lock && rm -rf vendor/* && composer install
cd ..
git pull
rm composer.lock && rm -rf vendor/* && composer install
./psh.phar docker:start && ./psh.phar docker:ssh
Enter fullscreen mode Exit fullscreen mode

Inside the docker container, don't use install but update!!!

./psh.phar update # don't use install or you lose data and configuration
Enter fullscreen mode Exit fullscreen mode

Then log in to the administration backend, configure storefront, reactivate themes and settings, and continue development.

To verify that you actually updated your shop, watch out for errors and deprectations, like EntityRepositoryInterface is now deprecated (although it is still being used in the official Shopware Academy developer tutorial videos). Just to make sure that (like JavaScript developers) there is always something to do, always some code to update just for the sake of updating?!

Of course, there are reasons. You can see all the details on GitHub (shopware/platform NEXT-21456). Shopware "deprecated EntityRepositoryInterface, the class will be removed with next major, type hint with EntityRepository instead". And there are more deprecations, like

bin/console dal:refresh:index 15:03:56 INFO [php] User Deprecated: Since shopware/core : Class "Shopware\Core\Framework\Routing\Annotation\RouteScope" is deprecated and will be removed in v6.5.0.0. Use ""@route(defaults={"_routeScope"={"storefront"}})"" instead.

Collapse
 
ingosteinke profile image
Ingo Steinke • Edited

I researched an reposted my inquiry about properly handling the deprecations introduced in the latest Shopware 6.4.13.0 release as a StackOverflow question: Replacement for deprecated Shopware EntityRepositoryInterface is also deprecated.

Thanks to shiyim's quick reply.

The deprecation of EntityRepository has been fixed with commit 99cf9093464d679f6abcb91bb68cc4205bc6ccf0

EntityRepository has now only @final github.com/shopware/platform/blob/...

According to Shopware 6.4.13.0 upgrade instructions, EntityRepositoryInterface has been deprecated and should be replaced by EntityRepository. But EntityRepository is also marked as deprecated in my IDE, using the recommended development setup all upgraded to the latest versions:

  • PhpStorm (2022.1.3 Build #PS-221.5921.28)
  • Symfony Support plugin 2022.1.230
  • Shopware plugin 4.4.3