From 9f6fae39de503757223987f6fbc9ad7817c62760 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Mon, 4 Nov 2024 02:09:19 +0100 Subject: [PATCH] Fix: cannot add to wishlist from tag page - Customer account (#4329) * Fixes: cannot add to wishlist from tag page - Customer account * rector --- .phpstan.dist.baseline.neon | 90 ------------------- .../Mage/Catalog/Block/Product/Abstract.php | 2 +- .../core/Mage/Review/Block/Product/View.php | 2 +- .../base/default/template/tag/cloud.phtml | 2 + .../template/tag/customer/recent.phtml | 2 + .../default/template/tag/customer/tags.phtml | 2 + .../default/template/tag/customer/view.phtml | 13 ++- .../base/default/template/tag/list.phtml | 2 + .../base/default/template/tag/popular.phtml | 2 + 9 files changed, 23 insertions(+), 94 deletions(-) diff --git a/.phpstan.dist.baseline.neon b/.phpstan.dist.baseline.neon index 91627a07966..a223cc0ae45 100644 --- a/.phpstan.dist.baseline.neon +++ b/.phpstan.dist.baseline.neon @@ -1565,11 +1565,6 @@ parameters: count: 1 path: app/code/core/Mage/Catalog/Block/Product.php - - - message: "#^Parameter \\#2 \\$templateType of method Mage_Review_Block_Helper\\:\\:getSummaryHtml\\(\\) expects string, bool given\\.$#" - count: 1 - path: app/code/core/Mage/Catalog/Block/Product/Abstract.php - - message: "#^Property Mage_Catalog_Block_Product_Abstract\\:\\:\\$_reviewsHelperBlock \\(Mage_Review_Block_Helper\\|null\\) does not accept Mage_Core_Block_Abstract\\|false\\.$#" count: 1 @@ -8970,21 +8965,11 @@ parameters: count: 2 path: app/design/frontend/base/default/template/catalog/product/compare/list.phtml - - - message: "#^Parameter \\#2 \\$templateType of method Mage_Catalog_Block_Product_Abstract\\:\\:getReviewsSummaryHtml\\(\\) expects bool, string given\\.$#" - count: 1 - path: app/design/frontend/base/default/template/catalog/product/compare/list.phtml - - message: "#^Variable \\$this might not be defined\\.$#" count: 24 path: app/design/frontend/base/default/template/catalog/product/gallery.phtml - - - message: "#^Parameter \\#2 \\$templateType of method Mage_Catalog_Block_Product_Abstract\\:\\:getReviewsSummaryHtml\\(\\) expects bool, string given\\.$#" - count: 1 - path: app/design/frontend/base/default/template/catalog/product/list.phtml - - message: "#^Variable \\$this might not be defined\\.$#" count: 17 @@ -10045,16 +10030,6 @@ parameters: count: 1 path: app/design/frontend/base/default/template/rating/empty.phtml - - - message: "#^Parameter \\#2 \\$templateType of method Mage_Catalog_Block_Product_Abstract\\:\\:getReviewsSummaryHtml\\(\\) expects bool, string given\\.$#" - count: 1 - path: app/design/frontend/base/default/template/reports/home_product_compared.phtml - - - - message: "#^Parameter \\#2 \\$templateType of method Mage_Catalog_Block_Product_Abstract\\:\\:getReviewsSummaryHtml\\(\\) expects bool, string given\\.$#" - count: 1 - path: app/design/frontend/base/default/template/reports/home_product_viewed.phtml - - message: "#^Variable \\$this might not be defined\\.$#" count: 12 @@ -10080,16 +10055,6 @@ parameters: count: 20 path: app/design/frontend/base/default/template/reports/widget/compared/content/compared_list.phtml - - - message: "#^Parameter \\#2 \\$templateType of method Mage_Catalog_Block_Product_Abstract\\:\\:getReviewsSummaryHtml\\(\\) expects bool, string given\\.$#" - count: 1 - path: app/design/frontend/base/default/template/reports/widget/viewed/content/viewed_grid.phtml - - - - message: "#^Parameter \\#2 \\$templateType of method Mage_Catalog_Block_Product_Abstract\\:\\:getReviewsSummaryHtml\\(\\) expects bool, string given\\.$#" - count: 1 - path: app/design/frontend/base/default/template/reports/widget/viewed/content/viewed_list.phtml - - message: "#^Variable \\$this might not be defined\\.$#" count: 17 @@ -10305,36 +10270,6 @@ parameters: count: 1 path: app/design/frontend/base/default/template/sales/reorder/sidebar.phtml - - - message: "#^Variable \\$this might not be defined\\.$#" - count: 5 - path: app/design/frontend/base/default/template/tag/cloud.phtml - - - - message: "#^Variable \\$this might not be defined\\.$#" - count: 7 - path: app/design/frontend/base/default/template/tag/customer/recent.phtml - - - - message: "#^Variable \\$this might not be defined\\.$#" - count: 11 - path: app/design/frontend/base/default/template/tag/customer/tags.phtml - - - - message: "#^Variable \\$this might not be defined\\.$#" - count: 31 - path: app/design/frontend/base/default/template/tag/customer/view.phtml - - - - message: "#^Variable \\$this might not be defined\\.$#" - count: 12 - path: app/design/frontend/base/default/template/tag/list.phtml - - - - message: "#^Variable \\$this might not be defined\\.$#" - count: 5 - path: app/design/frontend/base/default/template/tag/popular.phtml - - message: "#^Variable \\$this might not be defined\\.$#" count: 22 @@ -10540,16 +10475,6 @@ parameters: count: 2 path: app/design/frontend/rwd/default/template/catalog/product/compare/list.phtml - - - message: "#^Parameter \\#2 \\$templateType of method Mage_Catalog_Block_Product_Abstract\\:\\:getReviewsSummaryHtml\\(\\) expects bool, string given\\.$#" - count: 1 - path: app/design/frontend/rwd/default/template/catalog/product/compare/list.phtml - - - - message: "#^Parameter \\#2 \\$templateType of method Mage_Catalog_Block_Product_Abstract\\:\\:getReviewsSummaryHtml\\(\\) expects bool, string given\\.$#" - count: 1 - path: app/design/frontend/rwd/default/template/catalog/product/list.phtml - - message: "#^Variable \\$this might not be defined\\.$#" count: 17 @@ -10590,11 +10515,6 @@ parameters: count: 1 path: app/design/frontend/rwd/default/template/catalog/product/view.phtml - - - message: "#^Parameter \\#2 \\$templateType of method Mage_Catalog_Block_Product_Abstract\\:\\:getReviewsSummaryHtml\\(\\) expects bool, string given\\.$#" - count: 1 - path: app/design/frontend/rwd/default/template/catalog/product/view.phtml - - message: "#^Variable \\$this might not be defined\\.$#" count: 8 @@ -10950,11 +10870,6 @@ parameters: count: 198 path: app/design/frontend/rwd/default/template/downloadable/sales/order/items/renderer/downloadable.phtml - - - message: "#^Parameter \\#2 \\$templateType of method Mage_Catalog_Block_Product_Abstract\\:\\:getReviewsSummaryHtml\\(\\) expects bool, string given\\.$#" - count: 1 - path: app/design/frontend/rwd/default/template/email/catalog/product/list.phtml - - message: "#^Variable \\$this might not be defined\\.$#" count: 10 @@ -11085,11 +11000,6 @@ parameters: count: 7 path: app/design/frontend/rwd/default/template/reports/widget/compared/content/compared_list.phtml - - - message: "#^Parameter \\#2 \\$templateType of method Mage_Catalog_Block_Product_Abstract\\:\\:getReviewsSummaryHtml\\(\\) expects bool, string given\\.$#" - count: 1 - path: app/design/frontend/rwd/default/template/reports/widget/viewed/content/viewed_grid.phtml - - message: "#^Variable \\$this might not be defined\\.$#" count: 34 diff --git a/app/code/core/Mage/Catalog/Block/Product/Abstract.php b/app/code/core/Mage/Catalog/Block/Product/Abstract.php index d92a6421c9d..e0cbade010a 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Product/Abstract.php @@ -271,7 +271,7 @@ public function addPriceBlockType($type, $block = '', $template = '') /** * Get product reviews summary * - * @param bool $templateType + * @param string|false $templateType * @param bool $displayIfNoReviews * @return string * @throws Mage_Core_Model_Store_Exception diff --git a/app/code/core/Mage/Review/Block/Product/View.php b/app/code/core/Mage/Review/Block/Product/View.php index 7f35e2afb17..1bbefc150c3 100644 --- a/app/code/core/Mage/Review/Block/Product/View.php +++ b/app/code/core/Mage/Review/Block/Product/View.php @@ -40,7 +40,7 @@ protected function _toHtml() * Replace review summary html with more detailed review summary * Reviews collection count will be jerked here * - * @param bool $templateType + * @param string|false $templateType * @param bool $displayIfNoReviews * @return string * @throws Mage_Core_Model_Store_Exception|Mage_Core_Exception diff --git a/app/design/frontend/base/default/template/tag/cloud.phtml b/app/design/frontend/base/default/template/tag/cloud.phtml index 7108c032e54..ad71fc7b754 100644 --- a/app/design/frontend/base/default/template/tag/cloud.phtml +++ b/app/design/frontend/base/default/template/tag/cloud.phtml @@ -12,6 +12,8 @@ * @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org) * @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ + +/** @var Mage_Tag_Block_All $this */ ?>

__('All Tags') ?>

diff --git a/app/design/frontend/base/default/template/tag/customer/recent.phtml b/app/design/frontend/base/default/template/tag/customer/recent.phtml index 866a80b5370..03ca2b80a94 100644 --- a/app/design/frontend/base/default/template/tag/customer/recent.phtml +++ b/app/design/frontend/base/default/template/tag/customer/recent.phtml @@ -12,6 +12,8 @@ * @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org) * @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ + +/** @var Mage_Tag_Block_Customer_Recent $this */ ?>