Skip to content
Snippets Groups Projects
Commit 45682db4 authored by Adil Siddiqui's avatar Adil Siddiqui Committed by Miha Wagner
Browse files

Re-commit for proper attribution; Issue #3345563 by Adil_Siddiqui: Deprecated...

Re-commit for proper attribution; Issue #3345563 by Adil_Siddiqui: Deprecated function: unserialize(): Passing null to parameter #1 ($data) of type string is deprecated
parent 75e0c165
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,7 @@ class ProductHasData extends FieldPluginBase {
* {@inheritDoc}
*/
public function render(ResultRow $values) {
$data = unserialize($this->getValue($values), ['allowed_classes' => FALSE]);
$data = !empty($this->getValue($values)) ? unserialize($this->getValue($values), ['allowed_classes' => FALSE]) : [];
if ($data === NULL || $data === FALSE) {
return [
'#markup' => '<span class="color-warning">' . $this->t('No') . '</span>',
......
......@@ -163,7 +163,7 @@ class ProductStore extends DatabaseStorage {
)->fetchAllAssoc('name');
foreach ($asins as $asin) {
if (isset($result[$asin])) {
$values[$asin] = $this->serializer->decode($result[$asin]->overrides);
$values[$asin] = $this->serializer->decode((string) $result[$asin]->overrides);
}
}
}
......@@ -189,8 +189,8 @@ class ProductStore extends DatabaseStorage {
)->fetchAllAssoc('name');
foreach ($keys as $key) {
if (isset($result[$key])) {
$values[$key] = $this->serializer->decode($result[$key]->value);
if ($overrides = $this->serializer->decode($result[$key]->overrides)) {
$values[$key] = $this->serializer->decode((string) $result[$key]->value);
if ($overrides = $this->serializer->decode((string) $result[$key]->overrides)) {
$values[$key]['overrides'] = $overrides;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment