Skip to content

Commit

Permalink
Fix: cannot add to wishlist from tag page - Customer account (#4329)
Browse files Browse the repository at this point in the history
* Fixes: cannot add to wishlist from tag page - Customer account

* rector
  • Loading branch information
sreichel authored Nov 4, 2024
1 parent 758f7ee commit 9f6fae3
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 94 deletions.
90 changes: 0 additions & 90 deletions .phpstan.dist.baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Block/Product/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Review/Block/Product/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions app/design/frontend/base/default/template/tag/cloud.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
?>
<div class="page-title">
<h1><?php echo $this->__('All Tags') ?></h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
?>
<div class="box-account box-tags">
<div class="box-head">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_Tags $this */
?>
<?php echo $this->getMessagesBlock()->toHtml() ?>
<div class="page-title">
Expand Down
13 changes: 11 additions & 2 deletions app/design/frontend/base/default/template/tag/customer/view.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -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_View $this */
?>
<div class="page-title">
<h1><?php echo $this->__('My Tags') ?></h1>
Expand All @@ -25,6 +27,7 @@
<?php echo $this->getToolbarHtml() ?>
<table class="data-table" id="my-tags-table">
<?php if(count($this->getMyProducts()) > 0): ?>
<?php $params[Mage_Core_Model_Url::FORM_KEY] = $this->getFormKey() ?>
<col width="1" />
<col />
<col width="1" />
Expand All @@ -41,14 +44,20 @@
</td>
<td>
<?php if($_product->isSaleable()): ?>
<?php $params[Mage_Core_Model_Url::FORM_KEY] = Mage::getSingleton('core/session')->getFormKey() ?>
<?php $params['product'] = $_product->getId(); ?>
<button type="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Add to Cart')) ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getUrl('checkout/cart/add', $params) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
<?php endif ?>
<?php if ($this->helper('wishlist')->isAllow()) : ?>
<ul class="add-to-links">
<li>
<a href="<?php echo $this->getUrl('wishlist/index/add', ['product'=>$_product->getId()]) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
<a href="#"
class="link-wishlist"
onclick="customFormSubmit(
'<?php echo $this->getAddToWishlistUrlCustom($_product, false) ?>',
'<?php echo $this->escapeHtml(json_encode(['form_key' => $params[Mage_Core_Model_Url::FORM_KEY]])) ?>',
'post')">
<?php echo $this->__('Add to Wishlist') ?>
</a>
</li>
</ul>
<?php endif ?>
Expand Down
2 changes: 2 additions & 0 deletions app/design/frontend/base/default/template/tag/list.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -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_Product_List $this */
?>
<div class="box-collateral box-tags">
<h2><?php echo $this->__('Product Tags') ?></h2>
Expand Down
2 changes: 2 additions & 0 deletions app/design/frontend/base/default/template/tag/popular.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -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_Popular $this */
?>
<div class="block block-tags">
<div class="block-title">
Expand Down

0 comments on commit 9f6fae3

Please sign in to comment.