Skip to content

Commit

Permalink
Merge pull request #19 from NicolasBarbey/main
Browse files Browse the repository at this point in the history
Fix module for php8
  • Loading branch information
julescournut authored Aug 27, 2021
2 parents 7405e60 + 171582d commit c0ffd70
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 2 additions & 3 deletions BetterSeo.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ class BetterSeo extends BaseModule
*/
public function postActivation(ConnectionInterface $con = null):void
{
try {
BetterSeoQuery::create()->findOne();
} catch (\Exception $e) {
if (!self::getConfigValue('is_initialized',null)){
$database = new Database($con);
$database->insertSql(null, [__DIR__ . "/Config/thelia.sql"]);
self::setConfigValue('is_initialized', 1);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Config/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>2.0.1</version>
<version>2.0.2</version>
<authors>
<author>
<name>Nicolas Barbey</name>
Expand Down
6 changes: 5 additions & 1 deletion Smarty/Plugins/BetterSeoMicroDataPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ public function betterSeoMicroData($params)
case 'product':
$id = $params['id'] ?? $this->request->get('product_id');
$product = ProductQuery::create()->filterById($id)->findOne();
$relatedProducts = \is_array($params['related_products']) ? $params['related_products'] : $this->explode($params['related_products']);
$relatedProducts = null;

if (array_key_exists('related_products', $params)){
$relatedProducts = \is_array($params['related_products']) ? $params['related_products'] : $this->explode($params['related_products']);
}

$microdata = $this->getProductMicroData($product, $lang, $relatedProducts);
break;
Expand Down

0 comments on commit c0ffd70

Please sign in to comment.