Skip to content

Commit 2969973

Browse files
authored
Make Mage_GiftMessage optional in templates (#4266)
* Make Mage_GiftMessage optional in templates * ~ add return parameters * ~ ractor * ~ fix getProductAdditionalInformationBlock return type, block might not exist * ~ add missing return type * ~ fix return type for overwrite * ~ fix missing return * ~ isModuleEnabled -> isModuleOutputEnabled * Update Grid.php * Update .phpstan.dist.baseline.neon * Update additional.phtml * Update .phpstan.dist.baseline.neon * Update default.phtml * Update Details.php * Update Items.php * Update .phpstan.dist.baseline.neon
1 parent 66b2261 commit 2969973

File tree

55 files changed

+477
-373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+477
-373
lines changed

.phpstan.dist.baseline.neon

Lines changed: 0 additions & 235 deletions
Original file line numberDiff line numberDiff line change
@@ -7680,11 +7680,6 @@ parameters:
76807680
count: 2
76817681
path: app/design/adminhtml/default/default/template/sales/order/address/form.phtml
76827682

7683-
-
7684-
message: "#^If condition is always true\\.$#"
7685-
count: 1
7686-
path: app/design/adminhtml/default/default/template/sales/order/create/giftmessage.phtml
7687-
76887683
-
76897684
message: "#^Method Mage_Adminhtml_Block_Sales_Order_Create_Abstract\\:\\:formatPrice\\(\\) invoked with 3 parameters, 1 required\\.$#"
76907685
count: 18
@@ -8150,51 +8145,6 @@ parameters:
81508145
count: 4
81518146
path: app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/options.phtml
81528147

8153-
-
8154-
message: "#^Variable \\$_item might not be defined\\.$#"
8155-
count: 1
8156-
path: app/design/frontend/base/default/template/bundle/email/order/items/creditmemo/default.phtml
8157-
8158-
-
8159-
message: "#^Variable \\$_showlastRow might not be defined\\.$#"
8160-
count: 1
8161-
path: app/design/frontend/base/default/template/bundle/email/order/items/creditmemo/default.phtml
8162-
8163-
-
8164-
message: "#^Variable \\$this might not be defined\\.$#"
8165-
count: 22
8166-
path: app/design/frontend/base/default/template/bundle/email/order/items/creditmemo/default.phtml
8167-
8168-
-
8169-
message: "#^Variable \\$_inc might not be defined\\.$#"
8170-
count: 1
8171-
path: app/design/frontend/base/default/template/bundle/email/order/items/invoice/default.phtml
8172-
8173-
-
8174-
message: "#^Variable \\$_item might not be defined\\.$#"
8175-
count: 1
8176-
path: app/design/frontend/base/default/template/bundle/email/order/items/invoice/default.phtml
8177-
8178-
-
8179-
message: "#^Variable \\$_showlastRow might not be defined\\.$#"
8180-
count: 1
8181-
path: app/design/frontend/base/default/template/bundle/email/order/items/invoice/default.phtml
8182-
8183-
-
8184-
message: "#^Variable \\$this might not be defined\\.$#"
8185-
count: 22
8186-
path: app/design/frontend/base/default/template/bundle/email/order/items/invoice/default.phtml
8187-
8188-
-
8189-
message: "#^Variable \\$this might not be defined\\.$#"
8190-
count: 27
8191-
path: app/design/frontend/base/default/template/bundle/email/order/items/order/default.phtml
8192-
8193-
-
8194-
message: "#^Variable \\$this might not be defined\\.$#"
8195-
count: 15
8196-
path: app/design/frontend/base/default/template/bundle/email/order/items/shipment/default.phtml
8197-
81988148
-
81998149
message: "#^Variable \\$_weeeTaxAttributes might not be defined\\.$#"
82008150
count: 8
@@ -8230,16 +8180,6 @@ parameters:
82308180
count: 173
82318181
path: app/design/frontend/base/default/template/bundle/sales/order/invoice/items/renderer.phtml
82328182

8233-
-
8234-
message: "#^Variable \\$this might not be defined\\.$#"
8235-
count: 181
8236-
path: app/design/frontend/base/default/template/bundle/sales/order/items/renderer.phtml
8237-
8238-
-
8239-
message: "#^Variable \\$this might not be defined\\.$#"
8240-
count: 20
8241-
path: app/design/frontend/base/default/template/bundle/sales/order/shipment/items/renderer.phtml
8242-
82438183
-
82448184
message: "#^Variable \\$this might not be defined\\.$#"
82458185
count: 17
@@ -8755,11 +8695,6 @@ parameters:
87558695
count: 9
87568696
path: app/design/frontend/base/default/template/checkout/onepage/shipping_method.phtml
87578697

8758-
-
8759-
message: "#^Variable \\$this might not be defined\\.$#"
8760-
count: 4
8761-
path: app/design/frontend/base/default/template/checkout/onepage/shipping_method/additional.phtml
8762-
87638698
-
87648699
message: "#^Variable \\$this might not be defined\\.$#"
87658700
count: 15
@@ -9040,26 +8975,6 @@ parameters:
90408975
count: 18
90418976
path: app/design/frontend/base/default/template/downloadable/email/order/items/invoice/downloadable.phtml
90428977

9043-
-
9044-
message: "#^Variable \\$this might not be defined\\.$#"
9045-
count: 28
9046-
path: app/design/frontend/base/default/template/downloadable/email/order/items/order/downloadable.phtml
9047-
9048-
-
9049-
message: "#^Variable \\$this might not be defined\\.$#"
9050-
count: 170
9051-
path: app/design/frontend/base/default/template/downloadable/sales/order/creditmemo/items/renderer/downloadable.phtml
9052-
9053-
-
9054-
message: "#^Variable \\$this might not be defined\\.$#"
9055-
count: 170
9056-
path: app/design/frontend/base/default/template/downloadable/sales/order/invoice/items/renderer/downloadable.phtml
9057-
9058-
-
9059-
message: "#^Variable \\$this might not be defined\\.$#"
9060-
count: 190
9061-
path: app/design/frontend/base/default/template/downloadable/sales/order/items/renderer/downloadable.phtml
9062-
90638978
-
90648979
message: "#^Variable \\$this might not be defined\\.$#"
90658980
count: 8
@@ -9070,11 +8985,6 @@ parameters:
90708985
count: 8
90718986
path: app/design/frontend/base/default/template/email/order/invoice/items.phtml
90728987

9073-
-
9074-
message: "#^Variable \\$this might not be defined\\.$#"
9075-
count: 16
9076-
path: app/design/frontend/base/default/template/email/order/items.phtml
9077-
90788988
-
90798989
message: "#^Variable \\$this might not be defined\\.$#"
90808990
count: 16
@@ -9085,11 +8995,6 @@ parameters:
90858995
count: 16
90868996
path: app/design/frontend/base/default/template/email/order/items/invoice/default.phtml
90878997

9088-
-
9089-
message: "#^Variable \\$this might not be defined\\.$#"
9090-
count: 24
9091-
path: app/design/frontend/base/default/template/email/order/items/order/default.phtml
9092-
90938998
-
90948999
message: "#^Variable \\$this might not be defined\\.$#"
90959000
count: 8
@@ -9385,31 +9290,16 @@ parameters:
93859290
count: 8
93869291
path: app/design/frontend/base/default/template/rss/list.phtml
93879292

9388-
-
9389-
message: "#^Variable \\$this might not be defined\\.$#"
9390-
count: 27
9391-
path: app/design/frontend/base/default/template/rss/order/details.phtml
9392-
93939293
-
93949294
message: "#^Variable \\$this might not be defined\\.$#"
93959295
count: 1
93969296
path: app/design/frontend/base/default/template/sales/guest/form.phtml
93979297

9398-
-
9399-
message: "#^Variable \\$this might not be defined\\.$#"
9400-
count: 5
9401-
path: app/design/frontend/base/default/template/sales/order/creditmemo.phtml
9402-
94039298
-
94049299
message: "#^Variable \\$this might not be defined\\.$#"
94059300
count: 17
94069301
path: app/design/frontend/base/default/template/sales/order/creditmemo/items.phtml
94079302

9408-
-
9409-
message: "#^Variable \\$this might not be defined\\.$#"
9410-
count: 167
9411-
path: app/design/frontend/base/default/template/sales/order/creditmemo/items/renderer/default.phtml
9412-
94139303
-
94149304
message: "#^Variable \\$this might not be defined\\.$#"
94159305
count: 21
@@ -9425,31 +9315,11 @@ parameters:
94259315
count: 10
94269316
path: app/design/frontend/base/default/template/sales/order/info/buttons.phtml
94279317

9428-
-
9429-
message: "#^Variable \\$this might not be defined\\.$#"
9430-
count: 5
9431-
path: app/design/frontend/base/default/template/sales/order/invoice.phtml
9432-
94339318
-
94349319
message: "#^Variable \\$this might not be defined\\.$#"
94359320
count: 15
94369321
path: app/design/frontend/base/default/template/sales/order/invoice/items.phtml
94379322

9438-
-
9439-
message: "#^Variable \\$this might not be defined\\.$#"
9440-
count: 167
9441-
path: app/design/frontend/base/default/template/sales/order/invoice/items/renderer/default.phtml
9442-
9443-
-
9444-
message: "#^Variable \\$this might not be defined\\.$#"
9445-
count: 18
9446-
path: app/design/frontend/base/default/template/sales/order/items.phtml
9447-
9448-
-
9449-
message: "#^Variable \\$this might not be defined\\.$#"
9450-
count: 187
9451-
path: app/design/frontend/base/default/template/sales/order/items/renderer/default.phtml
9452-
94539323
-
94549324
message: "#^Variable \\$this might not be defined\\.$#"
94559325
count: 18
@@ -9470,31 +9340,16 @@ parameters:
94709340
count: 17
94719341
path: app/design/frontend/base/default/template/sales/order/recent.phtml
94729342

9473-
-
9474-
message: "#^Variable \\$this might not be defined\\.$#"
9475-
count: 5
9476-
path: app/design/frontend/base/default/template/sales/order/shipment.phtml
9477-
94789343
-
94799344
message: "#^Variable \\$this might not be defined\\.$#"
94809345
count: 22
94819346
path: app/design/frontend/base/default/template/sales/order/shipment/items.phtml
94829347

9483-
-
9484-
message: "#^Variable \\$this might not be defined\\.$#"
9485-
count: 15
9486-
path: app/design/frontend/base/default/template/sales/order/shipment/items/renderer/default.phtml
9487-
94889348
-
94899349
message: "#^Variable \\$this might not be defined\\.$#"
94909350
count: 23
94919351
path: app/design/frontend/base/default/template/sales/order/trackinginfo.phtml
94929352

9493-
-
9494-
message: "#^Variable \\$this might not be defined\\.$#"
9495-
count: 22
9496-
path: app/design/frontend/base/default/template/sales/order/view.phtml
9497-
94989353
-
94999354
message: "#^Call to method __\\(\\) on an unknown class Mage_Sale_Block_Reorder_Sidebar\\.$#"
95009355
count: 6
@@ -9625,56 +9480,6 @@ parameters:
96259480
count: 1
96269481
path: app/design/frontend/rwd/default/template/bundle/catalog/product/view/type/bundle/option/select.phtml
96279482

9628-
-
9629-
message: "#^Variable \\$_item might not be defined\\.$#"
9630-
count: 1
9631-
path: app/design/frontend/rwd/default/template/bundle/email/order/items/creditmemo/default.phtml
9632-
9633-
-
9634-
message: "#^Variable \\$_showlastRow might not be defined\\.$#"
9635-
count: 1
9636-
path: app/design/frontend/rwd/default/template/bundle/email/order/items/creditmemo/default.phtml
9637-
9638-
-
9639-
message: "#^Variable \\$this might not be defined\\.$#"
9640-
count: 25
9641-
path: app/design/frontend/rwd/default/template/bundle/email/order/items/creditmemo/default.phtml
9642-
9643-
-
9644-
message: "#^Variable \\$_inc might not be defined\\.$#"
9645-
count: 1
9646-
path: app/design/frontend/rwd/default/template/bundle/email/order/items/invoice/default.phtml
9647-
9648-
-
9649-
message: "#^Variable \\$_item might not be defined\\.$#"
9650-
count: 1
9651-
path: app/design/frontend/rwd/default/template/bundle/email/order/items/invoice/default.phtml
9652-
9653-
-
9654-
message: "#^Variable \\$_showlastRow might not be defined\\.$#"
9655-
count: 1
9656-
path: app/design/frontend/rwd/default/template/bundle/email/order/items/invoice/default.phtml
9657-
9658-
-
9659-
message: "#^Variable \\$this might not be defined\\.$#"
9660-
count: 25
9661-
path: app/design/frontend/rwd/default/template/bundle/email/order/items/invoice/default.phtml
9662-
9663-
-
9664-
message: "#^Variable \\$this might not be defined\\.$#"
9665-
count: 29
9666-
path: app/design/frontend/rwd/default/template/bundle/email/order/items/order/default.phtml
9667-
9668-
-
9669-
message: "#^Variable \\$this might not be defined\\.$#"
9670-
count: 16
9671-
path: app/design/frontend/rwd/default/template/bundle/email/order/items/shipment/default.phtml
9672-
9673-
-
9674-
message: "#^Variable \\$this might not be defined\\.$#"
9675-
count: 181
9676-
path: app/design/frontend/rwd/default/template/bundle/sales/order/items/renderer.phtml
9677-
96789483
-
96799484
message: "#^Call to method escapeUrl\\(\\) on an unknown class Mage_Catalog_Block_Layer_Filter\\.$#"
96809485
count: 1
@@ -10100,16 +9905,6 @@ parameters:
101009905
count: 19
101019906
path: app/design/frontend/rwd/default/template/downloadable/email/order/items/invoice/downloadable.phtml
101029907

10103-
-
10104-
message: "#^Variable \\$this might not be defined\\.$#"
10105-
count: 29
10106-
path: app/design/frontend/rwd/default/template/downloadable/email/order/items/order/downloadable.phtml
10107-
10108-
-
10109-
message: "#^Variable \\$this might not be defined\\.$#"
10110-
count: 198
10111-
path: app/design/frontend/rwd/default/template/downloadable/sales/order/items/renderer/downloadable.phtml
10112-
101139908
-
101149909
message: "#^Variable \\$this might not be defined\\.$#"
101159910
count: 10
@@ -10125,11 +9920,6 @@ parameters:
101259920
count: 8
101269921
path: app/design/frontend/rwd/default/template/email/order/invoice/items.phtml
101279922

10128-
-
10129-
message: "#^Variable \\$this might not be defined\\.$#"
10130-
count: 16
10131-
path: app/design/frontend/rwd/default/template/email/order/items.phtml
10132-
101339923
-
101349924
message: "#^Variable \\$this might not be defined\\.$#"
101359925
count: 17
@@ -10140,11 +9930,6 @@ parameters:
101409930
count: 17
101419931
path: app/design/frontend/rwd/default/template/email/order/items/invoice/default.phtml
101429932

10143-
-
10144-
message: "#^Variable \\$this might not be defined\\.$#"
10145-
count: 25
10146-
path: app/design/frontend/rwd/default/template/email/order/items/order/default.phtml
10147-
101489933
-
101499934
message: "#^Variable \\$this might not be defined\\.$#"
101509935
count: 8
@@ -10270,11 +10055,6 @@ parameters:
1027010055
count: 22
1027110056
path: app/design/frontend/rwd/default/template/sales/order/creditmemo/items.phtml
1027210057

10273-
-
10274-
message: "#^Variable \\$this might not be defined\\.$#"
10275-
count: 173
10276-
path: app/design/frontend/rwd/default/template/sales/order/creditmemo/items/renderer/default.phtml
10277-
1027810058
-
1027910059
message: "#^Variable \\$this might not be defined\\.$#"
1028010060
count: 19
@@ -10285,21 +10065,6 @@ parameters:
1028510065
count: 18
1028610066
path: app/design/frontend/rwd/default/template/sales/order/invoice/items.phtml
1028710067

10288-
-
10289-
message: "#^Variable \\$this might not be defined\\.$#"
10290-
count: 172
10291-
path: app/design/frontend/rwd/default/template/sales/order/invoice/items/renderer/default.phtml
10292-
10293-
-
10294-
message: "#^Variable \\$this might not be defined\\.$#"
10295-
count: 18
10296-
path: app/design/frontend/rwd/default/template/sales/order/items.phtml
10297-
10298-
-
10299-
message: "#^Variable \\$this might not be defined\\.$#"
10300-
count: 191
10301-
path: app/design/frontend/rwd/default/template/sales/order/items/renderer/default.phtml
10302-
1030310068
-
1030410069
message: "#^Variable \\$this might not be defined\\.$#"
1030510070
count: 17

app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,14 @@ protected function _getGiftmessageSaveModel()
7474
{
7575
return Mage::getSingleton('adminhtml/giftmessage_save');
7676
}
77+
78+
public function canDisplayGiftmessage(): bool
79+
{
80+
if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) {
81+
return false;
82+
}
83+
/** @var Mage_GiftMessage_Helper_Message $helper */
84+
$helper = $this->helper('giftmessage/message');
85+
return $helper->getIsMessagesAvailable('order', $this->getEntity(), $this->getEntity()->getStoreId());
86+
}
7787
}

0 commit comments

Comments
 (0)