From 3255587f1f2451452b87fa822ed7b4605ae51bd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Thu, 28 Jun 2018 15:45:50 +0200 Subject: [PATCH] Avoid error in case provided reseller code is invalid --- .../Classes/Controller/ResellerController.php | 8 ++++++-- .../Private/Templates/Reseller/List.html | 18 ++++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/web/typo3conf/ext/ep_products/Classes/Controller/ResellerController.php b/web/typo3conf/ext/ep_products/Classes/Controller/ResellerController.php index 1fd5aae4..bdb51857 100644 --- a/web/typo3conf/ext/ep_products/Classes/Controller/ResellerController.php +++ b/web/typo3conf/ext/ep_products/Classes/Controller/ResellerController.php @@ -63,9 +63,13 @@ class ResellerController extends ActionController /** * @param Reseller $reseller */ - public function listAction(Reseller $reseller) + public function listAction(Reseller $reseller = null) { - $products = $reseller->getProducts(); + $products = []; + + if ($reseller !== null) { + $products = $reseller->getProducts(); + } $this->view->assign('reseller', $reseller); $this->view->assign('products', $products); diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Reseller/List.html b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Reseller/List.html index 43489749..0aa6bd76 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Reseller/List.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Reseller/List.html @@ -8,14 +8,16 @@
-

Gesamtexport XML

- Export XML -

Einzelexport Excel

-
    - -
  • Export XLS: {product.name}
  • -
    -
+ +

Gesamtexport XML

+ Export XML +

Einzelexport Excel

+
    + +
  • Export XLS: {product.name}
  • +
    +
+