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
|
||||
*/
|
||||
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);
|
||||
|
||||
@@ -8,14 +8,16 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<h2>Gesamtexport XML</h2>
|
||||
<f:link.action arguments="{reseller: reseller}" pageType="1972" target="_blank">Export XML</f:link.action>
|
||||
<h2>Einzelexport Excel</h2>
|
||||
<ul>
|
||||
<f:for each="{products}" as="product">
|
||||
<li><f:link.action arguments="{product: product, reseller: reseller}" pageType="1984">Export XLS: {product.name}</f:link.action></li>
|
||||
</f:for>
|
||||
</ul>
|
||||
<f:if condition="{reseller}">
|
||||
<h2>Gesamtexport XML</h2>
|
||||
<f:link.action arguments="{reseller: reseller}" pageType="1972" target="_blank">Export XML</f:link.action>
|
||||
<h2>Einzelexport Excel</h2>
|
||||
<ul>
|
||||
<f:for each="{products}" as="product">
|
||||
<li><f:link.action arguments="{product: product, reseller: reseller}" pageType="1984">Export XLS: {product.name}</f:link.action></li>
|
||||
</f:for>
|
||||
</ul>
|
||||
</f:if>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user