Avoid error in case provided reseller code is invalid
This commit is contained in:
@@ -63,9 +63,13 @@ class ResellerController extends ActionController
|
|||||||
/**
|
/**
|
||||||
* @param Reseller $reseller
|
* @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('reseller', $reseller);
|
||||||
$this->view->assign('products', $products);
|
$this->view->assign('products', $products);
|
||||||
|
|||||||
@@ -8,14 +8,16 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<h2>Gesamtexport XML</h2>
|
<f:if condition="{reseller}">
|
||||||
<f:link.action arguments="{reseller: reseller}" pageType="1972" target="_blank">Export XML</f:link.action>
|
<h2>Gesamtexport XML</h2>
|
||||||
<h2>Einzelexport Excel</h2>
|
<f:link.action arguments="{reseller: reseller}" pageType="1972" target="_blank">Export XML</f:link.action>
|
||||||
<ul>
|
<h2>Einzelexport Excel</h2>
|
||||||
<f:for each="{products}" as="product">
|
<ul>
|
||||||
<li><f:link.action arguments="{product: product, reseller: reseller}" pageType="1984">Export XLS: {product.name}</f:link.action></li>
|
<f:for each="{products}" as="product">
|
||||||
</f:for>
|
<li><f:link.action arguments="{product: product, reseller: reseller}" pageType="1984">Export XLS: {product.name}</f:link.action></li>
|
||||||
</ul>
|
</f:for>
|
||||||
|
</ul>
|
||||||
|
</f:if>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user