Skip to content

Commit

Permalink
Webservice: fix product creation php errors
Browse files Browse the repository at this point in the history
Fix php errors thrown during product creation via API.
  • Loading branch information
getdatakick committed Mar 12, 2021
1 parent 76fc6c9 commit d8fc1d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion classes/Product.php
Expand Up @@ -7392,7 +7392,7 @@ public function getCoverWs()
{
$result = $this->getCover($this->id);

return $result['id_image'];
return isset($result['id_image']) ? $result['id_image'] : null;
}

/**
Expand Down Expand Up @@ -8039,6 +8039,9 @@ public function getWsType()
*/
public function modifierWsLinkRewrite()
{
if (! $this->link_rewrite) {
$this->link_rewrite = [];
}
foreach ($this->name as $idLang => $name) {
if (empty($this->link_rewrite[$idLang])) {
$this->link_rewrite[$idLang] = Tools::link_rewrite($name);
Expand Down

0 comments on commit d8fc1d5

Please sign in to comment.