Skip to content

Commit

Permalink
[StorageList] rename token to identifier and remove ShareController
Browse files Browse the repository at this point in the history
  • Loading branch information
dpfaffenbauer committed Dec 6, 2022
1 parent 747596c commit d353098
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,10 @@ routes:
priority: 2

coreshop_wishlist_summary:
pattern: '/(\w+)\/shop\/wishlist(\/(.*))?$/'
reverse: '/%_locale/shop/wishlist/{%token}'
pattern: '/(\w+)\/shop\/wishlist(?:\/((.*)))$/'
reverse: '/%_locale/shop/wishlist/{%identifier}'
controller: 'coreshop.storage_list.controller.wishlist:summaryAction'
variables: _locale,token
variables: _locale,identifier
priority: 2

coreshop_wishlist_add:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ public function summaryAction(Request $request): Response
$repository = $this->repository;
$isSharedList = false;

if ($request->attributes->get('token')) {
if ($request->attributes->get('identifier')) {
if (!$repository instanceof ShareableStorageListRepositoryInterface) {
throw new NotFoundHttpException();
}

$list = $repository->findByToken($request->attributes->get('token'));
$list = $repository->findByToken($request->attributes->get('identifier'));
$isSharedList = true;

if (null === $list) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ private function addStorageListSection(ArrayNodeDefinition $node): void
->arrayNode('routes')
->addDefaultsIfNotSet()
->children()
->scalarNode('index')->cannotBeEmpty()->end()
->scalarNode('summary')->cannotBeEmpty()->end()
->scalarNode('index')->cannotBeEmpty()->end()
->end()
->end()
->arrayNode('templates')
Expand All @@ -117,13 +117,6 @@ private function addStorageListSection(ArrayNodeDefinition $node): void
->scalarNode('class')->defaultValue(StorageListController::class)->end()
->end()
->end()
->arrayNode('share_controller')
->addDefaultsIfNotSet()
->children()
->booleanNode('enabled')->defaultFalse()->end()
->scalarNode('class')->defaultValue(StorageListShareController::class)->end()
->end()
->end()
->end()
->end()
->end()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
use CoreShop\Component\StorageList\Core\Context\CustomerAndStoreBasedStorageListContext;
use CoreShop\Component\StorageList\Core\Context\SessionAndStoreBasedStorageListContext;
use CoreShop\Component\StorageList\Core\Context\StoreBasedStorageListContext;
use CoreShop\Component\StorageList\Model\ShareableStorageListInterface;
use CoreShop\Component\StorageList\StorageListsManager;
use CoreShop\Component\Store\Model\StoreAwareInterface;
use Pimcore\Http\Request\Resolver\PimcoreContextResolver;
Expand Down

0 comments on commit d353098

Please sign in to comment.