From 4bb4d2dc64a2b4da27e19bea370374742405ca18 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 7 Oct 2022 08:54:13 +0200 Subject: [PATCH 1/5] FIX remove db object for avoid error with postgresql --- htdocs/variants/ajax/get_attribute_values.php | 5 +++++ htdocs/variants/combinations.php | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/variants/ajax/get_attribute_values.php b/htdocs/variants/ajax/get_attribute_values.php index 1d4eab49773..7a18f54657b 100644 --- a/htdocs/variants/ajax/get_attribute_values.php +++ b/htdocs/variants/ajax/get_attribute_values.php @@ -77,6 +77,11 @@ $prodattrval = new ProductAttributeValue($db); $res = $prodattrval->fetchAllByProductAttribute($id); +// Remove db for avoid error with postgresql +foreach ($res as $key => $val) { + unset($res[$key]->db); +} + if ($res == -1) { print json_encode(array( 'error' => 'Internal error' diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index f8fb962e1ef..adf396bf88d 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -477,8 +477,9 @@ if (!empty($id) || !empty($ref)) { foreach ($prodattr_all as $each) { $prodattr_alljson[$each->id] = $each; + // Remove db for avoid error with postgresql + unset($prodattr_alljson[$each->id]->db); } - ?>