Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Mage_GiftMessage optional in templates #4266

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
240 changes: 0 additions & 240 deletions .phpstan.dist.baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8010,16 +8010,6 @@ parameters:
count: 21
path: app/design/adminhtml/default/default/template/sales/order/create/form/address.phtml

-
message: "#^If condition is always true\\.$#"
count: 1
path: app/design/adminhtml/default/default/template/sales/order/create/giftmessage.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 9
path: app/design/adminhtml/default/default/template/sales/order/create/giftmessage.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 3
Expand Down Expand Up @@ -8810,51 +8800,6 @@ parameters:
count: 4
path: app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/options.phtml

-
message: "#^Variable \\$_item might not be defined\\.$#"
count: 1
path: app/design/frontend/base/default/template/bundle/email/order/items/creditmemo/default.phtml

-
message: "#^Variable \\$_showlastRow might not be defined\\.$#"
count: 1
path: app/design/frontend/base/default/template/bundle/email/order/items/creditmemo/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 22
path: app/design/frontend/base/default/template/bundle/email/order/items/creditmemo/default.phtml

-
message: "#^Variable \\$_inc might not be defined\\.$#"
count: 1
path: app/design/frontend/base/default/template/bundle/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$_item might not be defined\\.$#"
count: 1
path: app/design/frontend/base/default/template/bundle/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$_showlastRow might not be defined\\.$#"
count: 1
path: app/design/frontend/base/default/template/bundle/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 22
path: app/design/frontend/base/default/template/bundle/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 27
path: app/design/frontend/base/default/template/bundle/email/order/items/order/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 15
path: app/design/frontend/base/default/template/bundle/email/order/items/shipment/default.phtml

-
message: "#^PHPDoc tag @var has invalid value \\(\\$_coreHelper Mage_Core_Helper_Data\\)\\: Unexpected token \"\\$_coreHelper\", expected type at offset 12 on line 2$#"
count: 1
Expand Down Expand Up @@ -8905,16 +8850,6 @@ parameters:
count: 173
path: app/design/frontend/base/default/template/bundle/sales/order/invoice/items/renderer.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 181
path: app/design/frontend/base/default/template/bundle/sales/order/items/renderer.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 20
path: app/design/frontend/base/default/template/bundle/sales/order/shipment/items/renderer.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 17
Expand Down Expand Up @@ -9475,11 +9410,6 @@ parameters:
count: 9
path: app/design/frontend/base/default/template/checkout/onepage/shipping_method.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 4
path: app/design/frontend/base/default/template/checkout/onepage/shipping_method/additional.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 15
Expand Down Expand Up @@ -9770,26 +9700,6 @@ parameters:
count: 18
path: app/design/frontend/base/default/template/downloadable/email/order/items/invoice/downloadable.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 28
path: app/design/frontend/base/default/template/downloadable/email/order/items/order/downloadable.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 170
path: app/design/frontend/base/default/template/downloadable/sales/order/creditmemo/items/renderer/downloadable.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 170
path: app/design/frontend/base/default/template/downloadable/sales/order/invoice/items/renderer/downloadable.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 190
path: app/design/frontend/base/default/template/downloadable/sales/order/items/renderer/downloadable.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 8
Expand All @@ -9800,11 +9710,6 @@ parameters:
count: 8
path: app/design/frontend/base/default/template/email/order/invoice/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 16
path: app/design/frontend/base/default/template/email/order/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 16
Expand All @@ -9815,11 +9720,6 @@ parameters:
count: 16
path: app/design/frontend/base/default/template/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 24
path: app/design/frontend/base/default/template/email/order/items/order/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 8
Expand Down Expand Up @@ -10150,31 +10050,16 @@ parameters:
count: 8
path: app/design/frontend/base/default/template/rss/list.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 27
path: app/design/frontend/base/default/template/rss/order/details.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 1
path: app/design/frontend/base/default/template/sales/guest/form.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 5
path: app/design/frontend/base/default/template/sales/order/creditmemo.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 17
path: app/design/frontend/base/default/template/sales/order/creditmemo/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 167
path: app/design/frontend/base/default/template/sales/order/creditmemo/items/renderer/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 21
Expand All @@ -10190,31 +10075,11 @@ parameters:
count: 10
path: app/design/frontend/base/default/template/sales/order/info/buttons.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 5
path: app/design/frontend/base/default/template/sales/order/invoice.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 15
path: app/design/frontend/base/default/template/sales/order/invoice/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 167
path: app/design/frontend/base/default/template/sales/order/invoice/items/renderer/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 18
path: app/design/frontend/base/default/template/sales/order/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 187
path: app/design/frontend/base/default/template/sales/order/items/renderer/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 18
Expand All @@ -10235,31 +10100,16 @@ parameters:
count: 17
path: app/design/frontend/base/default/template/sales/order/recent.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 5
path: app/design/frontend/base/default/template/sales/order/shipment.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 22
path: app/design/frontend/base/default/template/sales/order/shipment/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 15
path: app/design/frontend/base/default/template/sales/order/shipment/items/renderer/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 23
path: app/design/frontend/base/default/template/sales/order/trackinginfo.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 22
path: app/design/frontend/base/default/template/sales/order/view.phtml

-
message: "#^Call to method __\\(\\) on an unknown class Mage_Sale_Block_Reorder_Sidebar\\.$#"
count: 6
Expand Down Expand Up @@ -10450,56 +10300,6 @@ parameters:
count: 1
path: app/design/frontend/rwd/default/template/bundle/catalog/product/view/type/bundle/option/select.phtml

-
message: "#^Variable \\$_item might not be defined\\.$#"
count: 1
path: app/design/frontend/rwd/default/template/bundle/email/order/items/creditmemo/default.phtml

-
message: "#^Variable \\$_showlastRow might not be defined\\.$#"
count: 1
path: app/design/frontend/rwd/default/template/bundle/email/order/items/creditmemo/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 25
path: app/design/frontend/rwd/default/template/bundle/email/order/items/creditmemo/default.phtml

-
message: "#^Variable \\$_inc might not be defined\\.$#"
count: 1
path: app/design/frontend/rwd/default/template/bundle/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$_item might not be defined\\.$#"
count: 1
path: app/design/frontend/rwd/default/template/bundle/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$_showlastRow might not be defined\\.$#"
count: 1
path: app/design/frontend/rwd/default/template/bundle/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 25
path: app/design/frontend/rwd/default/template/bundle/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 29
path: app/design/frontend/rwd/default/template/bundle/email/order/items/order/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 16
path: app/design/frontend/rwd/default/template/bundle/email/order/items/shipment/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 181
path: app/design/frontend/rwd/default/template/bundle/sales/order/items/renderer.phtml

-
message: "#^Call to method escapeUrl\\(\\) on an unknown class Mage_Catalog_Block_Layer_Filter\\.$#"
count: 1
Expand Down Expand Up @@ -10940,16 +10740,6 @@ parameters:
count: 19
path: app/design/frontend/rwd/default/template/downloadable/email/order/items/invoice/downloadable.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 29
path: app/design/frontend/rwd/default/template/downloadable/email/order/items/order/downloadable.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
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
Expand All @@ -10970,11 +10760,6 @@ parameters:
count: 8
path: app/design/frontend/rwd/default/template/email/order/invoice/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 16
path: app/design/frontend/rwd/default/template/email/order/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 17
Expand All @@ -10985,11 +10770,6 @@ parameters:
count: 17
path: app/design/frontend/rwd/default/template/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 25
path: app/design/frontend/rwd/default/template/email/order/items/order/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 8
Expand Down Expand Up @@ -11120,11 +10900,6 @@ parameters:
count: 22
path: app/design/frontend/rwd/default/template/sales/order/creditmemo/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 173
path: app/design/frontend/rwd/default/template/sales/order/creditmemo/items/renderer/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 19
Expand All @@ -11135,21 +10910,6 @@ parameters:
count: 18
path: app/design/frontend/rwd/default/template/sales/order/invoice/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 172
path: app/design/frontend/rwd/default/template/sales/order/invoice/items/renderer/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 18
path: app/design/frontend/rwd/default/template/sales/order/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 191
path: app/design/frontend/rwd/default/template/sales/order/items/renderer/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 17
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,14 @@ protected function _getGiftmessageSaveModel()
{
return Mage::getSingleton('adminhtml/giftmessage_save');
}

public function canDisplayGiftmessage(): bool
{
if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) {
return false;
}
/** @var Mage_GiftMessage_Helper_Message $helper */
$helper = $this->helper('giftmessage/message');
return $helper->getIsMessagesAvailable('order', $this->getEntity(), $this->getEntity()->getStoreId());
}
}
Loading
Loading