Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
Merge 3.x into master
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI committed Jan 9, 2020
2 parents 9d9f1a2 + 2708de5 commit b2a727e
Show file tree
Hide file tree
Showing 31 changed files with 595 additions and 59 deletions.
17 changes: 16 additions & 1 deletion UPGRADE-3.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,27 @@ UPGRADE 3.x

UPGRADE FROM 3.0 to 3.1
=======================

## Fix products collection navigation

Product's collections are available on product page. The collection page
display a list of all similar products.

## Remove deprecated calls

`Sonata\Doctrine\Model\PageableManagerInterface` is no longer used in profit of
`Sonata\DatagridBundle\Pager\PageableInterface`

## Added missing profile part to CustomerBundle

Profile dependencies are no longer fetched from SonataUserBundle, but you can
use this profile by changing the configuration (`template` and `menu_builder`).


## Fix products collection navigation
Product's collections are available on product page. The collection page display a list of all similar products.

## Remove deprecated calls
`Sonata\Doctrine\Model\PageableManagerInterface` is no longer used in profit of `Sonata\DatagridBundle\Pager\PageableInterface`

## Deprecated not passing dependencies to `Sonata\PaymentBundle\Controller\PaymentController`

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"sonata-project/classification-bundle": "^3.3",
"sonata-project/comment-bundle": "^3.1",
"sonata-project/core-bundle": "^3.15.1",
"sonata-project/datagrid-bundle": "^2.3",
"sonata-project/datagrid-bundle": "^2.5",
"sonata-project/doctrine-extensions": "^1.5",
"sonata-project/doctrine-orm-admin-bundle": "^3.2",
"sonata-project/formatter-bundle": "^3.4 || ^4.0",
Expand Down
9 changes: 7 additions & 2 deletions src/BasketBundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$node = $treeBuilder->root('sonata_basket');
$treeBuilder = new TreeBuilder('sonata_basket');
// Keep compatibility with symfony/config < 4.2
if (!method_exists($treeBuilder, 'getRootNode')) {
$node = $treeBuilder->root('sonata_basket');
} else {
$node = $treeBuilder->getRootNode();
}

$node
->children()
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Basket/BasketManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
namespace Sonata\Component\Basket;

use Sonata\Component\Customer\CustomerInterface;
use Sonata\DatagridBundle\Pager\PageableInterface;
use Sonata\Doctrine\Model\ManagerInterface;
use Sonata\Doctrine\Model\PageableManagerInterface;

interface BasketManagerInterface extends ManagerInterface, PageableManagerInterface
interface BasketManagerInterface extends ManagerInterface, PageableInterface
{
/**
* @return BasketInterface|null
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Customer/AddressManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

namespace Sonata\Component\Customer;

use Sonata\DatagridBundle\Pager\PageableInterface;
use Sonata\Doctrine\Model\ManagerInterface;
use Sonata\Doctrine\Model\PageableManagerInterface;

interface AddressManagerInterface extends ManagerInterface, PageableManagerInterface
interface AddressManagerInterface extends ManagerInterface, PageableInterface
{
/**
* Sets $address the current customer address.
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Customer/CustomerManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace Sonata\Component\Customer;

use Sonata\DatagridBundle\Pager\PageableInterface;
use Sonata\Doctrine\Model\ManagerInterface;
use Sonata\Doctrine\Model\PageableManagerInterface;

interface CustomerManagerInterface extends ManagerInterface, PageableManagerInterface
interface CustomerManagerInterface extends ManagerInterface, PageableInterface
{
}
4 changes: 2 additions & 2 deletions src/Component/Invoice/InvoiceManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace Sonata\Component\Invoice;

use Sonata\DatagridBundle\Pager\PageableInterface;
use Sonata\Doctrine\Model\ManagerInterface;
use Sonata\Doctrine\Model\PageableManagerInterface;

interface InvoiceManagerInterface extends ManagerInterface, PageableManagerInterface
interface InvoiceManagerInterface extends ManagerInterface, PageableInterface
{
}
4 changes: 2 additions & 2 deletions src/Component/Order/OrderManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

namespace Sonata\Component\Order;

use Sonata\DatagridBundle\Pager\PageableInterface;
use Sonata\Doctrine\Model\ManagerInterface;
use Sonata\Doctrine\Model\PageableManagerInterface;
use Sonata\UserBundle\Model\UserInterface;

interface OrderManagerInterface extends ManagerInterface, PageableManagerInterface
interface OrderManagerInterface extends ManagerInterface, PageableInterface
{
/**
* Finds orders belonging to given user.
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Product/ProductManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

namespace Sonata\Component\Product;

use Sonata\DatagridBundle\Pager\PageableInterface;
use Sonata\Doctrine\Model\ManagerInterface;
use Sonata\Doctrine\Model\PageableManagerInterface;

interface ProductManagerInterface extends ManagerInterface, PageableManagerInterface
interface ProductManagerInterface extends ManagerInterface, PageableInterface
{
/**
* Returns the products in the same collections as those specified in $productCollections.
Expand Down
9 changes: 7 additions & 2 deletions src/CustomerBundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$node = $treeBuilder->root('sonata_customer');
$treeBuilder = new TreeBuilder('sonata_customer');
// Keep compatibility with symfony/config < 4.2
if (!method_exists($treeBuilder, 'getRootNode')) {
$node = $treeBuilder->root('sonata_customer');
} else {
$node = $treeBuilder->getRootNode();
}

$this->addModelSection($node);
$this->addProfileSection($node);
Expand Down
9 changes: 7 additions & 2 deletions src/DeliveryBundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$node = $treeBuilder->root('sonata_delivery');
$treeBuilder = new TreeBuilder('sonata_delivery');
// Keep compatibility with symfony/config < 4.2
if (!method_exists($treeBuilder, 'getRootNode')) {
$node = $treeBuilder->root('sonata_delivery');
} else {
$node = $treeBuilder->getRootNode();
}

$node
->children()
Expand Down
9 changes: 7 additions & 2 deletions src/InvoiceBundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$node = $treeBuilder->root('sonata_invoice');
$treeBuilder = new TreeBuilder('sonata_invoice');
// Keep compatibility with symfony/config < 4.2
if (!method_exists($treeBuilder, 'getRootNode')) {
$node = $treeBuilder->root('sonata_invoice');
} else {
$node = $treeBuilder->getRootNode();
}

$this->addModelSection($node);

Expand Down
9 changes: 7 additions & 2 deletions src/OrderBundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$node = $treeBuilder->root('sonata_order');
$treeBuilder = new TreeBuilder('sonata_order');
// Keep compatibility with symfony/config < 4.2
if (!method_exists($treeBuilder, 'getRootNode')) {
$node = $treeBuilder->root('sonata_order');
} else {
$node = $treeBuilder->getRootNode();
}

$this->addModelSection($node);

Expand Down
9 changes: 7 additions & 2 deletions src/PaymentBundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$node = $treeBuilder->root('sonata_payment');
$treeBuilder = new TreeBuilder('sonata_payment');
// Keep compatibility with symfony/config < 4.2
if (!method_exists($treeBuilder, 'getRootNode')) {
$node = $treeBuilder->root('sonata_payment');
} else {
$node = $treeBuilder->getRootNode();
}

$node
->children()
Expand Down
9 changes: 7 additions & 2 deletions src/PriceBundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$node = $treeBuilder->root('sonata_price');
$treeBuilder = new TreeBuilder('sonata_price');
// Keep compatibility with symfony/config < 4.2
if (!method_exists($treeBuilder, 'getRootNode')) {
$node = $treeBuilder->root('sonata_price');
} else {
$node = $treeBuilder->getRootNode();
}

$this->addPriceSection($node);
$this->addPrecisionSection($node);
Expand Down
10 changes: 10 additions & 0 deletions src/ProductBundle/Block/CatalogBreadcrumbBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ protected function getMenu(BlockContextInterface $blockContext)
}
}

if ($collection = $blockContext->getBlock()->getSetting('collection')) {
$menu->addChild($collection->getName(), [
'route' => 'sonata_catalog_collection',
'routeParameters' => [
'collection_id' => $collection->getId(),
'collection_slug' => $collection->getSlug(),
],
]);
}

if ($product) {
$menu->addChild($product->getName(), [
'route' => 'sonata_product_view',
Expand Down
Loading

0 comments on commit b2a727e

Please sign in to comment.