Skip to content

Commit 689e4b4

Browse files
author
Maxime Biloé
authored
Merge pull request #4 from PrestaShop/xGouley-16-17-compat
// 1.7 compatibility for product links
2 parents 086bfd6 + 238d3cf commit 689e4b4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

statscheckup.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,11 @@ public function hookAdminStatsModules()
269269
$scores['average'] = array_sum($scores) / $divisor;
270270
$scores['average'] = ($scores['average'] < 1 ? 0 : ($scores['average'] > 1.5 ? 2 : 1));
271271

272+
$urlParams = array('id_product' => $row['id_product'], 'updateproduct' => 1, 'token' => $token_products);
272273
$this->html .= '
273274
<tr>
274275
<td>'.$row['id_product'].'</td>
275-
<td><a href="'.Tools::safeOutput('index.php?tab=AdminProducts&updateproduct&id_product='.$row['id_product'].'&token='.$token_products).'">'.Tools::substr($row['name'], 0, 42).'</a></td>
276+
<td><a href="'.Tools::safeOutput(preg_replace("/\\?.*$/", '?tab=AdminProducts&updateproduct&id_product='.$row['id_product'].'&token='.$token_products, $this->context->link->getAdminLink('AdminProducts', true, $urlParams))).'">'.Tools::substr($row['name'], 0, 42).'</a></td>
276277
<td class="center">'.$array_colors[$scores['active']].'</td>';
277278
foreach ($languages as $language)
278279
if (isset($row['desclength_'.$language['iso_code']]))

0 commit comments

Comments
 (0)