- BC BREAK:
OrderShowMenuBuilderconstructor now requires the fourth argument beingSymfony\Component\Security\Csrf\CsrfTokenManagerInterfaceinstance due to security reasons.
- BC BREAK:
Sylius\Bundle\ResourceBundle\Controller::applyStateMachineTransitionActionmethod now includes CSRF token checks due to security reasons. If you used it for REST API, these checks can be disabled by addingcsrf_protection: falseto your routing configuration.
Sylius\Bundle\CoreBundle\Templating\Helper\VariantResolverHelper'sresolveVariant(ProductInterface $product): ProductVariantInterfacesignature was changed toresolveVariant(ProductInterface $product): ?ProductVariantInterfacein order to reflect the real behaviour.
Sylius\Bundle\AdminApiBundle\Model\ClientManager'sfindClientByPublicId($publicId): ClientInterfacesignature was changed tofindClientByPublicId($publicId): ?ClientInterfacein order to reflect the real behaviour.
-
Parameter
localehas been removed fromparameters.yml.distandparameters.ymlfile and is now configured as default inapp/config/config.yml. If you would like to use a different default locale you should modify it there and commit such change to your project repository. -
\DateTimeInterfaceis used for typehints instead of\DateTimeto allow for compatibility with\DateTimeImmutable. Do not rely on mutable behaviour and set changes directly on the model. -
WebServerBundlewhich is used to run PHP's internal web server is no longer loaded in the production environment. You can re-add the bundle if you need to by adding the following code to your AppKernel.php:public function registerBundles() { // Other registrered bundles if (in_array($this->getEnvironment(), ['prod'])) { $bundles[] = new \Symfony\Bundle\WebServerBundle\WebServerBundle(); } return array_merge(parent::registerBundles(), $bundles); }
-
Scalar and return typehints have been introduced in the codebase. Please introduce these in your codebase for classes that implement Sylius interfaces or extend Sylius classes. It is also highly recommended to add
declare(strict_types=1);declaration to your PHP files. Learn more about PHP 7.1 features here: https://php.net/manual/de/migration71.new-features.php -
Starting with Symfony version 3.3.8, the custom autoloader is not needed anymore and therefore it has been removed in favour of the Composer autoloader. Apply the following changes (reference: Sylius#8340):
- Remove
app/autoload.php - Change autoload path in
bin/console: replace 'app' with 'vendor' - Change autoload path in
web/app.php: replace 'app' with 'vendor' - Change autoload path in
web/app_dev.php: replace 'app' with 'vendor' - Change autoload path in
phpunit.xml.dist: replace 'app' with 'vendor' - Remove
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",from composer.json scripts
- Remove
-
Model classes now return ArrayCollections instead of arrays, so if you want to mock it in PHPSpec, you need to wrap the mocked object like this:
function it_does_something( ReviewableInterface $reviewable, ReviewInterface $review ): void { $reviewable->getReviews()->willReturn(new ArrayCollection([$review->getWrappedObject()])); }
-
Moreover remember that you will have to change typehints from array to ArrayCollection in you classes, not only in tests.
-
Due to new Twig version, macros in included templates need to be imported in the child template. Read more here: https://stackoverflow.com/questions/41590051/twig-2-0-error-message-accessing-twig-template-attributes-is-forbidden/41590052
-
Check the differences between
TestAppKernelyou have and the one from Sylius/Sylius repository, as it was changed. -
The issue
Warning: Cannot bind closure to scope of internal class ReflectionPropertyshould be fixed by clearing the cache.
-
ZoneMatcherhas been made final, use decoration instead of extending it. -
The following methods no longer have a default null argument and require one to be explicitly passed:
AddressInterface::setCountryCodeAddressInterface::setProviceCodeAddressInterface::setProviceNameProvinceInterface::setCountryZoneMemberInterface::setBelongsTo
SelectAttributeTypehas been made final, use decoration instead of extending it.AttributeFactoryhas been made final, use decoration instead of extending it.ProductAttributeValueInterface::setProductmethod no longer has a default null argument and requires one to be explicitly passed.- The
AttributeTranslationInterfacenow extends theSylius\Component\Resource\Model\TranslationInterface.
CustomerStatisticsControllerhas been made final, use decoration instead of extending it.DashboardControllerhas been made final, use decoration instead of extending it.ImpersonateUserControllerhas been made final, use decoration instead of extending it.
CreateClientCommandhas been made final, use decoration instead of extending it.
-
ChannelFactoryhas been made final, use decoration instead of extending it. -
ChannelAwareInterface::setChannelno longer has a default null argument and requires one to be explicitly passed.
-
Method
OrderInterface::isShippingRequiredadded, used in place of similar methods inOrderShippingMethodSelectionRequirementCheckerandOrderShipmentProcessor -
createByCustomerAndChannelIdQueryBuilder($customerId, $channelId)method added toOrderRepositoryInterface -
The following classes have been made final, use decoration instead of extending them:
CartItemTypeExtensionCartTypeExtensionHandleExceptionIntegerDistributorMissingChannelConfigurationExceptionPromotionActionFactoryPromotionRuleFactoryReviewerReviewsRemoverTestPromotionFactoryUnsupportedTaxCalculationStrategyExceptionCheckoutStepsHelperPriceHelperProductVariantsPricesHelperVariantResolverHelper
-
The following methods no longer have a default null argument and require one to be explicitly passed:
ChannelPricingInterface::setProductVariantCustomerInterface::setDefaultAddressOrderInterface::setPromotionCouponProductInterface::setMainTaxonProductVariantInterface::setTaxCategoryShippingMethodInterface::setTaxCategoryShippingMethodInterface::setZoneTaxRateInterface::setZone
-
Constructor of
Sylius\Bundle\CoreBundle\Context\SessionAndChannelBasedCartContexthas been changed to useSylius\Component\Core\Storage\CartStorageInterface -
SessionCartSubscriberandShopUserLogoutHandlerhas been moved to ShopBundle. If you used them, you need to add ShopBundle to your Kernel or define this services by your own. -
The service definition of
session_and_channel_basedhas been moved to ShopBundle. If you used it, you need to add ShopBundle to your Kernel or define this services by your own. -
AssociationHydratorwas moved tosylius-labs/association-hydratorpackage. -
Protected methods
ShopUser::assignUserandCustomer::assignCustomerwere deleted.
-
The following methods no longer have a default null argument and require one to be explicitly passed:
CustomerInterface::setBirthdayCustomerInterface::setGroupCustomerAwareInterface::setCustomer
InventoryHelperhas been made final, use decoration instead of extending it.
Emailhas been made final, use decoration instead of extending it.SenderInterface::sendmethod has been changed:replyToargument was added.
-
In order to be compatible with Doctrine ORM 2.6+ and be more consistent,
OrderRepositoryInterface::count()signature was changed toOrderRepositoryInterface::countPlacedOrders(). -
The following methods no longer have a default null argument and require one to be explicitly passed:
AdjustableInterface::getAdjustmentsAdjustmentInterface::setAdjustableOrderAwareInterace::setOrderOrderInterface::setCheckoutCompletedAt
-
OrderInterface::getAdjustmentsRecursivelyandOrderItemInterface::getAdjustmentsRecursivelyreturn types changed fromarraytoCollection. -
In order to display information only about fulfilled orders in the dashboard statistics the
OrderRepositoryInterface::countByChannel()method's signature was changed toOrderRepositoryInterface::countFulfilledByChannel(). -
The service definition of
sylius.context.cart.session_basedhas been removed. Declare it by your own if you want to useSessionBasedCartContext<service id="sylius.context.cart.session_based" class="Sylius\Bundle\OrderBundle\Context\SessionBasedCartContext"> <argument type="service" id="session" /> <argument>_sylius.cart</argument> <argument type="service" id="sylius.repository.order" /> <tag name="sylius.context.cart" priority="-777" /> </service>
- In
PaymentInterface::setMethodthePaymentMethodInterface $methodparameter no longer has a default value. - The
PaymentMethodTranslationInterfacenow extends theSylius\Component\Resource\Model\TranslationInterface.
-
ProductVariantCombinationhas been made final, use decoration instead of extending it. -
ProductVariantCombinationValidatorhas been made final, use decoration instead of extending it. -
The following methods no longer have a default null argument and require one to be explicitly passed:
ProductAssociationInterface::setOwnerProductAttributeValueInterface::setProductProductOptionValueInterface::setOptionProductVariantInterface::setProduct
-
Sylius\Component\Product\Repository\ProductVariantRepositoryInterfacedefinition changed.findByCodeAndProductCode(string $code, string $productCode)was changed tofindByCodesAndProductCode(array $codes, string $productCode).
-
The
ProductAssociationTypeTranslationInterfacenow extends theSylius\Component\Resource\Model\TranslationInterface. -
The
ProductOptionTranslationInterfacenow extends theSylius\Component\Resource\Model\TranslationInterface. -
The
ProductOptionValueTranslationInterfacenow extends theSylius\Component\Resource\Model\TranslationInterface. -
The
ProductVariantTranslationInterfacenow extends theSylius\Component\Resource\Model\TranslationInterface.
ActivePromotionsProviderhas been made final, use decoration instead of extending it.- The following methods no longer have a default null argument and require one to be explicitly passed:
PromotionCouponGeneratorInstructionInterface::setExpiresAtPromotionCouponInterface::setPromotionPromotionCouponInterface::setExpiresAtPromotionInterface::setStartsAtPromotionInterface::setEndsAtPromotionRuleInterface::setPromotion
createPaginatorForPromotion(string $promotionCode)added toPromotionCouponRepositoryInterface
PrioritizedServiceRegistryInterface::allmethod return type changed from Zend'sPriorityQueuetoiterable.
-
The following methods no longer have a default null argument and require one to be explicitly passed:
TranslationInterface::setTranslatableArchivable::setArchivedAtSlugAwareInterface::setSlug
-
dispatchMultiple(string $eventName, RequestConfiguration $requestConfiguration, $resources)added toEventDispatcherInterface
- The
ReviewInterface::setAuthormethod no longer has a default null argument and requires one to be explicitly passed. - The
ReviewFactoryInterface::createForSubjectWithReviewermethod no longer has a default null value for$reviewerargument and requires one to be explicitly passed. - Default null value of
ReviewFactoryInterface::createForSubjectWithReviewerwas removed. To create a review without reviewer usecreateForSubjectmethod from the same interface instead.
-
ContactControllerhas been made final, use decoration instead of extending it. -
_liip_imaginerouting import has been moved to the main routing of Sylius app. If you are not importingapp/config/routing.ymlyou need to add this import by your own:_liip_imagine: resource: "@LiipImagineBundle/Resources/config/routing.xml"
-
ImagineBundle has been upgraded from ^1.6 to ^1.9.1 to move past a BC break in console commands: https://github.com/liip/LiipImagineBundle/releases/tag/1.9.1.
-
If
sylius_shop.locale_switcheris set tostorage,LocaleStrippingRouteris loaded, which strips out_localeparameter from the URL if it's the same as the one already in the storage. In order to disable localized urls, follow this cookbook entry: https://docs.sylius.com/en/latest/cookbook/disabling-localised-urls.html -
ShopUserLogoutHandlerhas different parameters in constructor:HttpUtils $httpUtilsstring $targetUrlChannelContextInterface $channelContextCartStorageInterface $cartStorage
-
Last constructor parameter of
SessionCartSubscriberis nowCartStorageInterface $cartStorageinstead ofstring $sessionKeyName
-
UnresolvedDefaultShippingMethodExceptionhas been made final, use decoration instead of extending it. -
setShippable(?ShippableInterface $shippable)method has been added toShipmentUnitInterface. -
The following methods no longer have a default null argument and require one to be explicitly passed:
ShipmentInterface::setMethodShipmentUnitInterface::setShipmentShipmentMethodInterface::setCategory
-
static
getCategoryRequirementLabelsmethod was removed fromShippingMethod -
getCategoryRequirementLabelmethod was removed fromShippingMethodInterface -
The
ShippingMethodTranslationInterfacenow extends theSylius\Component\Resource\Model\TranslationInterface.
-
The following methods no longer have a default null argument and require one to be explicitly passed:
TaxRateInterface::setTranslatableTaxRateInterface::setCategory
TaxonInterface::getParentsmethod was renamed toTaxonInterface::getAncestors.
ThemeHierarchyProviderInterface::getThemeHierarchyno longer accepts null as the passed argument.
-
The following classes have been made final, use decoration instead of extending them:
UserDeleteListenerUserLastLoginSubscriberUserReloaderListener
-
The following methods no longer have a default null argument and require one to be explicitly passed:
UserAwareInterface::setUserUserInterface::setPasswordRequestedAtUserInterface::setVerifiedAtUserInterface::setExpiresAtUserInterface::setLastLogin
-
The following tag attributes were renamed in order to keep consistency with Symfony (changes not needed if using XML for service definitions):
- from
form-typetoform_type - from
attribute-typetoattribute_type - from
configuration-form-typetoconfiguration_form_type
- from
- Constructor of
CapturePaymentActionnow takes aPaymentDescriptionProviderInterfaceas first argument. This allows granular customisation of the payment description.
-
Sylius\Bundle\TaxonomyBundle\Controller\TaxonSlugControllerhas been made final, decorate it or copy instead of extending it. -
Sylius\Component\Taxonomy\Generator\TaxonSlugGeneratorInterface::generatesignature has changed fromgenerate(string $name, ?mixed $parentId = null): stringtogenerate(TaxonInterface $taxon, ?string $locale = null): string.
-
The following serialization configuration was moved from CoreBundle/Resources/config/app/config.yml to AdminApiBundle/Resources/config/app/config.yml
jms_serializer: metadata: directories: sylius-core: namespace_prefix: "Sylius\\Component\\Core" path: "@SyliusCoreBundle/Resources/config/serializer"
to
jms_serializer: metadata: directories: sylius-core: namespace_prefix: "Sylius\\Component\\Core" path: "@SyliusAdminApiBundle/Resources/config/serializer"
-
Relations in serializations files were moved from Sylius bundles to SyliusAdminApiBundle
Example of relation for SyliusOrderBundle/Resources/config/serializer/Model.OrderItem.yml
relations: - rel: order href: route: sylius_admin_api_order_show parameters: id: expr(object.getOrder().getId()) version: 1 exclusion: groups: [Default, Detailed, DetailedCart]
-
The following serialization configurations files were moved:
- from
SyliusCoreBundle/Resources/config/serializer/Model.AdminUser.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.AdminUser.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.Channel.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.Channel.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.ChannelPricing.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.ChannelPricing.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.Customer.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.Customer.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.Image.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.Image.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.Order.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.Order.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.OrderItem.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.OrderItem.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.OrderItemUnit.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.OrderItemUnit.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.Payment.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.Payment.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.PaymentMethod.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.PaymentMethod.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.Product.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.Product.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.ProductImage.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.ProductImage.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.ProductTaxon.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.ProductTaxon.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.ProductVariant.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.ProductVariant.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.Promotion.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.Promotion.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.PromotionCoupon.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.PromotionCoupon.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.Property.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.Property.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.Shipment.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.Shipment.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.ShippingMethod.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.ShippingMethod.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.ShopUser.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.ShopUser.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.TaxRate.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.TaxRate.yml - from
SyliusCoreBundle/Resources/config/serializer/Model.Taxon.ymltoSyliusAdminApiBundle/Resources/config/serializer/Model.Taxon.yml
- from
- Bundles, container extensions and bundles configurations were made final and can't be extended anymore, follow Symfony best practices and do not extend them.
-
Route
sylius_admin_order_shipment_shiphas been added to have specific endpoint only for updating via HTTP PUT method andsylius_admin_partial_shipment_shiproute is only for rendering the form. -
Route
sylius_admin_address_log_entry_indexwas renamed tosylius_admin_partial_log_entry_index. -
Class
Sylius\Bundle\AdminBundle\Controller\NotificationControllerhas been made final and can't be extended anymore, follow Symfony best practices and do not extend it.
-
Bundle was renamed from
ApiBundletoAdminApiBundle. Routing and config was changed fromsylius_apitosylius_admin_api. -
Change the import path of your API config from
@SyliusApiBundle/Resources/config/app/config.ymlto@SyliusAdminApiBundle/Resources/config/app/config.yml(in fileapp/config/config.yml). -
Change the import path of your API routing from
src/Sylius/Bundle/ApiBundle/Resources/config/routing/main.ymltosrc/Sylius/Bundle/AdminApiBundle/Resources/config/routing.yml. API became versioned, so you need to prefix them accordingly (e.g./api/customer->/api/v1/customer). -
Routing for the following resources has been changed to use code instead of id:
ProductsProduct VariantsTaxons
You can bring back previous configuration by overriding current routing with your definition.
-
Routing for the following resources has been removed and replaced with the auto generated routing:
Channels, which are now resolved by code instead of id and only index and show endpoint are available.Countries, which are now resolved by code instead of id.Locales, which are now resolved by code instead of id.Product Attributes, which are now by code instead of id and only index and show endpoint are available.Product Options, which are now resolved by code instead of id and only index and show endpoint are available.Promotions, which are now resolved by code instead of id.Promotions Coupons, which are now resolved by code instead of id and only index and show endpoint are available.Shipping Categories, which are now resolved by code instead of id.Tax Categories, which are now resolved by code instead of id.Tax Rates, which have now only index and show endpoint available.Payment Methods, which have now only show endpoint available.
You can bring back previous configuration by overriding current routing with your definition.
-
AttributeValue::$localeCodeproperty was added to make it translatable. Now, every attribute value has a locale code to be displayed properly in different locales. All attribute values are migrated to the new concept with migrationVersion20170109143010. Look at this PR if you have any problems with upgrade. -
Sylius\Component\Attribute\Repository\AttributeRepositoryInterfaceand its implementations were removed due to not being used anymore. You can bring back missingfindByNamemethod by copying it from Git history to your codebase.
-
ImageUniqueCodeandImageUniqueCodeValidatorwere deleted and replaced byUniqueWithinCollectionConstraintandUniqueWithinCollectionConstraintValidatorfromResourceBundle. To use it replace name of constraint in constraint mapping file fromSylius\Bundle\CoreBundle\Validator\Constraints\ImageUniqueCodetoSylius\Bundle\ResourceBundle\Validator\Constraints\UniqueWithinCollectionConstraint -
Renamed
getLastNewPayment()onOrderInterfacetogetLastPayment($state), where$stateis target last payment state. EverygetLastNewPayment()method should be replaced withgetLastPayment(PaymentInterface::STATE_NEW). -
Sylius\Component\Core\OrderProcessing\OrderTaxesProcessorandSylius\Component\Core\Resolver\ZoneAndChannelBasedShippingMethodsResolverhave become a zone scope aware. From now, only zones with scopeshippingorallwill be considered inSylius\Component\Core\Resolver\ZoneAndChannelBasedShippingMethodsResolverand a scopetaxorallis required bySylius\Component\Core\OrderProcessing\OrderTaxesProcessor. A migration file has been prepared which fill inallas scope for zones that didn't have it specified, so they will be resolved by new implementation. -
State resolvers have been made final. In order to change theirs behavior please decorate them or provide your own implementation.
-
Sylius\Bundle\CoreBundle\DependencyInjection\Compiler\RoutingRepositoryPasswas removed, implement it yourself. -
Method
createQueryBuilderByChannelAndTaxonSlugfromSylius\Bundle\CoreBundle\Doctrine\ORM\ProductRepositoryInterfacewas renamed tocreateShopListQueryBuilderand receives taxon object instead of taxon slug string as the second parameter. -
Sylius\Bundle\CoreBundle\Test\MySqlDriverandSylius\Bundle\CoreBundle\Test\PgSqlDriverwere removed in favour ofdama/doctrine-test-bundlepackage. -
Sylius\Component\Core\Test\Services\RandomInvoiceNumberGeneratorwas moved toSylius\Component\Core\Payment\RandomInvoiceNumberGenerator, change your usages accordingly. -
Sylius\Component\Core\Payment\RandomInvoiceNumberGeneratorandSylius\Component\Core\Payment\IdBasedInvoiceNumberGeneratorwere made final, use decoration and implementSylius\Component\Core\Payment\InvoiceNumberGeneratorInterfaceinstead of extending them. -
Sylius\Component\Core\Currency\SessionBasedCurrencyStoragewas removed and replaced by more genericSylius\Component\Core\Currency\CurrencyStorage -
The following classes were removed due to being no longer used in current implementation:
Sylius\Bundle\CoreBundle\Handler\ShopCurrencyChangeHandlerSylius\Component\Core\Currency\Handler\CompositeCurrencyChangeHandlerSylius\Component\Core\Currency\Handler\CurrencyChangeHandlerInterfaceSylius\Component\Core\Provider\ChannelBasedCurrencyProviderSylius\Component\Core\SyliusCurrencyEvents
-
The following classes and interfaces was removed due to changes in locales handling (prepending them in URLs):
Sylius\Bundle\CoreBundle\Handler\CartLocaleChangeHandlerSylius\Bundle\CoreBundle\Handler\ShopLocaleChangeHandlerSylius\Component\Core\Locale\Handler\CompositeLocaleChangeHandlerSylius\Component\Core\Locale\Handler\LocaleChangeHandlerInterface
-
Sylius\Component\Core\Repository\ProductRepositoryInterfacedefinition changed.-
findLatestByChannel(ChannelInterface $channel, int $count)was changed tofindLatestByChannel(ChannelInterface $channel, string $locale, int $count). Please provide your current locale to fetch products together with their translations. -
findOneBySlugAndChannel(string $slug, ChannelInterface $channel)was changed tofindOneByChannelAndSlug(ChannelInterface $channel, string $locale, string $slug). Please provide your current locale to fetch product together with its translations. -
findOneBySlug(string $slug)was removed and replaced with more specificfindOneByChannelAndSlug(ChannelInterface $channel, string $locale, string $slug).
-
-
Added
Payment::$gatewayConfigproperty (with corresponding getter and setter) to allow dynamic gateways. Use it instead of oldPayment::$gatewayproperty. -
The following methods were added to
Sylius\Component\Core\Repository\OrderRepositoryInterface:findCartForSummary($id): ?OrderInterfacefindCartForAddressing($id): ?OrderInterfacefindCartForSelectingShipping($id): ?OrderInterfacefindCartForSelectingPayment($id): ?OrderInterface
-
Channelrelation was removed fromChannelPricingmodel.ChannelPricing::$channelCodeshould be used instead. -
The following classes were moved:
- from
Sylius\Bundle\CoreBundle\EmailManager\ShipmentEmailManagertoSylius\Bundle\AdminBundle\EmailManager\ShipmentEmailManager - from
Sylius\Bundle\CoreBundle\EmailManager\ShipmentEmailManagerInterfacetoSylius\Bundle\AdminBundle\EmailManager\ShipmentEmailManagerInterface - from
Sylius\Bundle\CoreBundle\EmailManager\ContactEmailManagertoSylius\Bundle\ShopBundle\EmailManager\ContactEmailManager - from
Sylius\Bundle\CoreBundle\EmailManager\ContactEmailManagerInterfacetoSylius\Bundle\ShopBundle\EmailManager\ContactEmailManagerInterface - from
Sylius\Bundle\CoreBundle\EmailManager\OrderEmailManagertoSylius\Bundle\ShopBundle\EmailManager\OrderEmailManager - from
Sylius\Bundle\CoreBundle\EmailManager\OrderEmailManagerInterfacetoSylius\Bundle\ShopBundle\EmailManager\OrderEmailManagerInterface - from
Sylius\Bundle\CoreBundle\EventListener\UserMailerListenertoSylius\Bundle\ShopBundle\EventListener\UserMailerListener
- from
-
The following email templates were moved:
- from
SyliusCoreBundle:Email:shipmentConfirmation.html.twigtoSyliusAdminBundle:Email:shipmentConfirmation.html.twig - from
SyliusCoreBundle:Email:contactRequest.html.twigtoSyliusShopBundle:Email:contactRequest.html.twig - from
SyliusCoreBundle:Email:orderConfirmation.html.twigtoSyliusShopBundle:Email:orderConfirmation.html.twig - from
SyliusCoreBundle:Email:userRegistration.html.twigtoSyliusShopBundle:Email:userRegistration.html.twig - from
SyliusCoreBundle:Email:passwordReset.html.twigtoSyliusShopBundle:Email:passwordReset.html.twig - from
SyliusCoreBundle:Email:verification.html.twigtoSyliusShopBundle:Email:verification.html.twig
- from
-
Removed class
Sylius\Bundle\CoreBundle\Form\Type\ProductTaxonChoiceType, useSylius\Bundle\CoreBundle\Form\Type\Taxon\ProductTaxonAutocompleteChoiceTypeinstead. -
Removed
Sylius\Bundle\CoreBundle\Form\Type\Promotion\PromotionConfigurationTypeclass as it has no behaviour and is not used. -
Removed
filterProductTaxonsByTaxonmethod fromProductTaxonAwareInterface, addedgetTaxonsandhasTaxonmethods. If you used the removed method to determine whether product belongs to a given taxon, usehasTaxoninstead. -
Removed
Sylius\Component\Core\Promotion\Action\ChannelBasedPromotionActionCommandInterfaceandSylius\Component\Core\Promotion\Checker\Rule\ChannelBasedRuleCheckerInterfaceinterfaces together withSylius\Bundle\CoreBundle\Form\EventSubscriber\BuildChannelBasedPromotionActionFormSubscriberandSylius\Bundle\CoreBundle\Form\EventSubscriber\BuildChannelBasedPromotionRuleFormSubscriberevent subscribers, which magically resolved channel-based configurations, look atChannelBased*Typeto implement your own channel-based configs. -
Services tagged with
sylius.promotion_actionandsylius.promotion_rule_checkermust includeform-typeparameter being the FQCN of configuration type. -
Removed class
Sylius\Component\Core\TokenAssigner\UniqueTokenGenerator, useSylius\Component\Resource\Generator\RandomnessGeneratorinstead.
-
The following classes were removed due to being no longer used in current implementation:
Sylius\Component\Currency\Provider\CurrencyProviderInterfaceSylius\Component\Currency\Context\ProviderBasedCurrencyContextSylius\Component\Currency\Provider\CurrencyProvider
-
sylius_currency.currencyconfiguration option was removed as well assylius_currency.currencyparameter.
-
Custom options for filter form types was extracted from
optionstoform_optionsin grid configuration.Before:
sylius_grid: grids: app_order: filters: channel: type: entity options: class: "%app.model.channel%" fields: [channel]
After:
sylius_grid: grids: app_order: filters: channel: type: entity options: fields: [channel] form_options: class: "%app.model.channel%"
-
Grid configuration was upgraded to allow setting the number of maximum visible items per page on index.
sylius_grid: grids: app_order: limits: [15, 20, 30]
Localemodel's$enabledfield has been removed along with all logic depending on it.
-
The
ExpiredCartsRemoverservice has been moved from the component and into the bundle. In addition it dispatches thesylius.carts.pre_removeandsylius.carts.post_removeevents, both of which hold the collection of carts to be, or already removed, depending on the event. Also, as of now, it depends on thesylius.manager.orderto remove the carts instead of the repository in order to not flush every outdatedcart, but the whole collection. -
Moved
Sylius\Component\Order\Factory\AddToCartCommandFactoryInterfacetoSylius\Bundle\OrderBundle\Factory\AddToCartCommandFactoryInterface.
-
Changed default
Payment::$statefrom new to cart. -
Credit Card model and all related code have been removed.
-
PaymentInterface::getSource()andPaymentInterface::setSource(PaymentSourceInterface $source)were removed. -
PaymentSourceInterfacehas been removed. -
voidtransition and state has been removed due to being not used.
-
There were changes made with handling payment states:
- authorized is treated as processing
- payedout is treated as refunded
-
Removed
Payment::$gatewayproperty and corresponding methods. -
Introduced
PaypalGatewayConfigurationTypeandStripeGatewayConfigurationTypefor dynamic gateways configuration.
-
ProductVariant::$nameproperty (and corresponding getter and setter) was removed to make it translatable. Therefore,ProductVariantTranslationwas introduced with one$nameproperty. All product variants names are migrated to new concept with migrationVersion2016121415313. Look at this PR if you have any problems with upgrade. -
ProductAssociationType::$nameproperty (and corresponding getter and setter) was removed to make it translatable. Therefore,ProductAssociationTypeTranslationwas introduced with one$nameproperty. All product association types names are migrated to new concept with migrationVersion20161219160441. Look at this PR if you have any problems with upgrade. -
Product::$availableOnandProduct::$availableUntilproperties (and corresponding getters and setters) were removed. Look at this PR if you have any problems with upgrade. -
ProductVariant::$availableOnandProductVariant::$availableUntilproperties (and corresponding getters and setters) were removed. -
ProductInterface::getAvailableVariants()method was removed as well. -
ProductVariantRepositoryInterface::findOneByCode($code)method has been replaced withProductVariantRepositoryInterface::findOneByCodeAndProductCode($code, $productCode). -
ProductVariantRepositoryInterface::findOneByIdAndProductId($id, $productId)method signature was added.
- Removed
Sylius\Bundle\PromotionBundle\Form\EventListener\AbstractConfigurationSubscriber,Sylius\Bundle\PromotionBundle\Form\EventListener\BuildPromotionActionFormSubscriberandSylius\Bundle\PromotionBundle\Form\EventListener\BuildPromotionRuleFormSubscriberevent subscribers, useSylius\Bundle\PromotionBundle\Form\Type\ConfigurablePromotionElementTypeas parent type instead.
-
Removed
sylius_resource.resources.*.translation.fieldsconfiguration key, it was not used at all - if causing issues, remove your configuration under it. -
Moved
Sylius\Bundle\ResourceBundle\Model\ResourceLogEntrytoSylius\Component\Resource\Model\ResourceLogEntry.
- Service
sylius.average_rating_updatername has been changed tosylius.product_review.average_rating_updaterand servicesylius.listener.review_changename has been changed tosylius.listener.product_review_changeThese services will be generated automatically based on subject name.
-
The following templates were moved:
@SyliusShop/Homepage/_header.html.twig->@SyliusShop/_header.html.twig@SyliusShop/Homepage/_footer.html.twig->@SyliusShop/_footer.html.twig@SyliusShop/Homepage/Menu/_security.html.twig->@SyliusShop/Menu/_security.html.twig@SyliusShop/_currencySwitch.html.twig->@SyliusShop/Menu/_currencySwitch.html.twig@SyliusShop/_localeSwitch.html.twig->@SyliusShop/Menu/_localeSwitch.html.twig
-
HomepageControllerhas been made final and can't be extended anymore, follow Symfony best practices and do not extend it. Instead extend theSymfony\Bundle\FrameworkBundle\Controller\Controllerand override thesylius.controller.shop.homepageservice definition.
-
Signature of method
findChildren(string $parentCode)inSylius\Component\Taxonomy\Repository\TaxonRepositoryInterfacewas changed tofindChildren(string $parentCode, string $locale). -
Removed
Sylius\Bundle\TaxonomyBundle\Form\Type\TaxonChoiceTypeandSylius\Bundle\TaxonomyBundle\Form\Type\TaxonCodeChoiceTypeform types. UseSylius\Bundle\TaxonomyBundle\Form\Type\TaxonAutocompleteChoiceTypeinstead. -
Removed method
findNodesTreeSorted()fromSylius\Component\Taxonomy\Repository\TaxonRepositoryInterface- provide your own implementation instead.
-
Sylius\Bundle\ThemeBundle\Translation\Provider\Locale\FallbackLocalesProviderandSylius\Bundle\ThemeBundle\Translation\Provider\Locale\FallbackLocalesProviderInterfacehave been removed. -
The fallback locales generation of
Sylius\Bundle\ThemeBundle\Translation\Translatorhas been nerfed to more strongly rely on symfony's default logic. From now on it won't compute every possible permutation of fallback locales from the given one, but only the themeless version, the base locale with and without theme's modifier, and every pre-configured fallback with and without the modifier.
-
Sylius\Bundle\UiBundle\Menu\AbstractMenuBuilderwas removed, you should add the following code to classes previously extending it:use Knp\Menu\FactoryInterface; use Symfony\Component\EventDispatcher\EventDispatcher; /** * @var FactoryInterface */ private $factory; /** * @var EventDispatcher */ private $eventDispatcher; /** * @param FactoryInterface $factory * @param EventDispatcher $eventDispatcher */ public function __construct(FactoryInterface $factory, EventDispatcher $eventDispatcher) { $this->factory = $factory; $this->eventDispatcher = $eventDispatcher; }
Also
sylius.menu_builderservice was removed, you should add the following code to services previously extending it:<argument type="service" id="knp_menu.factory" /> <argument type="service" id="event_dispatcher" />
-
sylius_admin_dashboard_redirectroute was removed, usesylius_admin_dashboardinstead. -
All shop routes became prepended with locale code, see below for required routing and security changes.
-
Shop only shows products / taxons having translations in current language.
-
Move
sylius_shoprouting belowsylius_adminandsylius_admin_apiinapp/config/routing.ymland replace it with the following one:sylius_shop: resource: "@SyliusShopBundle/Resources/config/routing.yml" prefix: /{_locale} requirements: _locale: ^[a-z]{2}(?:_[A-Z]{2})?$ sylius_shop_default_locale: path: / methods: [GET] defaults: _controller: sylius.controller.shop.locale_switch:switchAction
-
Payum gateways configuration is now done in Admin panel. Don't use
ymlfile to configure your custom gateways. -
While providing multiple locales you need to insert the two letter base (i.e.
en), along with the%locale%parameter, to the fallbacks array inapp/config/config.yml.framework: translator: { fallbacks: ["%locale%", "en"] }
-
Payum routes were made independent of the current locale. Add the following code to
app/config/routing.yml:sylius_shop_payum: resource: "@SyliusShopBundle/Resources/config/routing/payum.yml"
-
Add exception config to
fos_restinconfig.yml:
fos_rest:
exception: ~-
Firewalls configuration was changed to provide better CSRF protection and turn on remember me feature, update your
app/config/security.yml:security: firewalls: admin: form_login: csrf_token_generator: security.csrf.token_manager csrf_parameter: _csrf_admin_security_token csrf_token_id: admin_authenticate remember_me: secret: "%secret%" path: /admin name: APP_ADMIN_REMEMBER_ME lifetime: 31536000 remember_me_parameter: _remember_me shop: form_login: csrf_token_generator: security.csrf.token_manager csrf_parameter: _csrf_shop_security_token csrf_token_id: shop_authenticate remember_me: secret: "%secret%" name: APP_SHOP_REMEMBER_ME lifetime: 31536000 remember_me_parameter: _remember_me
From now on you need to pass CSRF token to your login-check request so you need to add
<input type="hidden" value={{ csrf_token('csrf_token_id') }} name="csrf_parameter">into your login form. Example input for admin login looks like<input type="hidden" name="_csrf_admin_security_token" value="{{ csrf_token('admin_authenticate') }}">.The remember me feature did not work properly due to missing additional configuration.
-
Securing partial routes and prepending shop URLs with locales need changes in
access_controlsection of yourapp/config/security.yml:security: access_control: - { path: "^/[^/]++/_partial", role: IS_AUTHENTICATED_ANONYMOUSLY, ips: [127.0.0.1, ::1] } - { path: "^/[^/]++/_partial", role: ROLE_NO_ACCESS } - { path: "^/[^/]++/login", role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: "^/(?!admin|api)[^/]++/register", role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: "^/(?!admin|api)[^/]++/verify", role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: "^/admin", role: ROLE_ADMINISTRATION_ACCESS } - { path: "^/api/.*", role: ROLE_API_ACCESS } - { path: "^/(?!admin|api)[^/]++/account", role: ROLE_USER }
-
Check if the Sylius migrations are in your
app/migrationsdirectory. If not, then add to this directory the migrations from thevendor/sylius/sylius/app/migrations/directory.If you've got your own migrations here, please run the migrations carefully. The doctrine migrations system is comparing dates of the migrations, then if some of your migrations have the same dates as migrations in Sylius, then they may corrupt the sequence of running Sylius migrations.
In such situations we suggest running migrations one by one, instead of all at once.
Sylius\Behat\Page\Admin\Crud\IndexPage,Sylius\Behat\Page\Admin\Crud\CreatePage,Sylius\Behat\Page\Admin\Crud\UpdatePagenow accepts route name instead of resource name.