Powerful and easy to use cms to build websites, blogs or ecommerce stores.
HTML backendblogblog-engineblog-platformbloggingcmscontent-managementcontent-management-systemecommerceecommerce-platformno-codepage-builderphpphp-cmsphp7php8self-hostedshopping-cartweb-applicationwebsite-builder
Product and product content meta api and post api model fixes
givanz1bb86a1d8c2d
diff --git a/admin/sql/mysqli/post_content_meta.sql b/admin/sql/mysqli/post_content_meta.sqlindex 891fc24..516f5b8 100644--- a/admin/sql/mysqli/post_content_meta.sql+++ b/admin/sql/mysqli/post_content_meta.sql@@ -50,13 +50,13 @@)BEGIN- INSERT INTO post_content_meta- (post_id, namespace, `key`, value, language_id)+ INSERT INTO post_content_meta+ (post_id, language_id, namespace, `key`, value )- VALUES (:post_id, :namespace, :key, :language_id, :value )+ VALUES (:post_id, :language_id, :namespace, :key , :value )- ON DUPLICATE KEY- UPDATE value = values(value);+ ON DUPLICATE KEY+ UPDATE value = values(value);END@@ -115,7 +115,7 @@VALUES ( :each, :post_id )ON DUPLICATE KEY- UPDATE value = VALUES(value);+ UPDATE value = VALUES(value);ENDdiff --git a/admin/sql/pgsql/post_content_meta.sql b/admin/sql/pgsql/post_content_meta.sqlindex 5f80bbc..84f5dec 100644--- a/admin/sql/pgsql/post_content_meta.sql+++ b/admin/sql/pgsql/post_content_meta.sql@@ -50,13 +50,12 @@)BEGIN- INSERT INTO post_content_meta- (post_id, namespace, "key", language_id, value )-- VALUES (:post_id, :namespace, :key, :language_id, :value )--- ON CONFLICT("post_id", "language_id","namespace", "key") DO UPDATE SET "value" = :each;+ INSERT INTO post_content_meta+ (post_id, language_id, namespace, "key", value )++ VALUES (:post_id, :language_id, :namespace, :key , :value )++ ON CONFLICT("post_id", "language_id","namespace", "key") DO UPDATE SET "value" = :value;ENDdiff --git a/admin/sql/pgsql/product_content_meta.sql b/admin/sql/pgsql/product_content_meta.sqlindex 0648ebb..c9c8a4b 100644--- a/admin/sql/pgsql/product_content_meta.sql+++ b/admin/sql/pgsql/product_content_meta.sql@@ -55,7 +55,7 @@VALUES (:product_id, :namespace, :key, :value, :language_id )- ON CONFLICT("product_id", "language_id","namespace", "key") DO UPDATE SET "value" = :each;+ ON CONFLICT("product_id", "language_id","namespace", "key") DO UPDATE SET "value" = :value;END@@ -114,7 +114,7 @@VALUES ( :each, :product_id )- ON CONFLICT("product_id", "language_id","namespace", "key") DO UPDATE SET "value" = :each;+ ON CONFLICT("product_id", "language_id","namespace", "key") DO UPDATE SET "value" = :each.value;ENDdiff --git a/admin/sql/sqlite/post_content_meta.sql b/admin/sql/sqlite/post_content_meta.sqlindex 8f0add3..d7c84ee 100644--- a/admin/sql/sqlite/post_content_meta.sql+++ b/admin/sql/sqlite/post_content_meta.sql@@ -50,13 +50,12 @@)BEGIN- INSERT INTO post_content_meta- (post_id, namespace, `key`, language_id, value )-- VALUES (:post_id, :namespace, :key, :language_id, :value )+ INSERT INTO post_content_meta+ (post_id, language_id, namespace, `key`, value )+ VALUES (:post_id, :language_id, :namespace, :key , :value )- ON CONFLICT(`post_id`, `language_id`,`namespace`, `key`) DO UPDATE SET `value` = :each;+ ON CONFLICT(`post_id`, `language_id`,`namespace`, `key`) DO UPDATE SET `value` = :value;ENDdiff --git a/admin/sql/sqlite/product_content_meta.sql b/admin/sql/sqlite/product_content_meta.sqlindex 887ca75..a700fc3 100644--- a/admin/sql/sqlite/product_content_meta.sql+++ b/admin/sql/sqlite/product_content_meta.sql@@ -55,7 +55,7 @@VALUES (:product_id, :namespace, :key, :value, :language_id )- ON CONFLICT(`product_id`, `language_id`,`namespace`, `key`) DO UPDATE SET `value` = :each;+ ON CONFLICT(`product_id`, `language_id`,`namespace`, `key`) DO UPDATE SET `value` = :value;END@@ -114,7 +114,7 @@VALUES ( :each, :product_id )- ON CONFLICT(`product_id`, `language_id`,`namespace`, `key`) DO UPDATE SET `value` = :each;+ ON CONFLICT(`product_id`, `language_id`,`namespace`, `key`) DO UPDATE SET value = :each.value;ENDdiff --git a/system/meta/product-content-meta.php b/system/meta/product-content-meta.phpnew file mode 100644index 0000000..bda1fcb--- /dev/null+++ b/system/meta/product-content-meta.php@@ -0,0 +1,29 @@+<?php++/**+ * Vvveb+ *+ * Copyright (C) 2022 Ziadin Givan+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <https://www.gnu.org/licenses/>.+ *+ */++namespace Vvveb\System\Meta;++class ProductContentMeta extends Meta {+ protected $modelName = 'product_content_meta';++ protected $item_id = 'product_id';+}diff --git a/system/meta/product-meta.php b/system/meta/product-meta.phpnew file mode 100644index 0000000..559799e--- /dev/null+++ b/system/meta/product-meta.php@@ -0,0 +1,29 @@+<?php++/**+ * Vvveb+ *+ * Copyright (C) 2022 Ziadin Givan+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <https://www.gnu.org/licenses/>.+ *+ */++namespace Vvveb\System\Meta;++class ProductMeta extends Meta {+ protected $modelName = 'product_meta';++ protected $item_id = 'product_id';+}