Skip to content

Commit 0d0765c

Browse files
committed
AC-1685: Fix Integration Tests to be compatible with PHP 8.1
1 parent 1541725 commit 0d0765c

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ public function _loadEntities($printQuery = false, $logQuery = false)
377377
$query = $this->getSelect();
378378
$rows = $this->_fetchAll($query);
379379
} catch (\Exception $e) {
380-
$this->printLogQuery(false, true, $query ?? 'n/a');
380+
$this->printLogQuery(false, true, $query);
381381
throw $e;
382382
}
383383

app/code/Magento/GiftMessage/Block/Message/Inline.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ public function getEntityHasMessage()
324324
*/
325325
public function getEscaped($value, $defaultValue = '')
326326
{
327-
return $this->escapeHtml(trim($value) != '' ? $value : $defaultValue);
327+
$value = ($value !== null && trim($value) != '') ? $value : $defaultValue;
328+
return $this->escapeHtml($value);
328329
}
329330

330331
/**

app/code/Magento/GiftMessage/view/frontend/templates/inline.phtml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ switch ($block->getCheckoutType()):
6464
name="giftmessage[quote][<?= (int) $block->getEntity()->getId() ?>][from]"
6565
id="gift-message-whole-from"
6666
title="<?= $block->escapeHtmlAttr(__('From')) ?>"
67-
value="<?= /* @noEscape */ $block->getEscaped($block->getMessage()->getSender() ?? '', $block->getDefaultFrom()) ?>"
67+
value="<?= /* @noEscape */ $block->getEscaped($block->getMessage()->getSender(), $block->getDefaultFrom()) ?>"
6868
class="input-text">
6969
</div>
7070
</div>
@@ -76,7 +76,7 @@ switch ($block->getCheckoutType()):
7676
<input type="text"
7777
name="giftmessage[quote][<?= (int) $block->getEntity()->getId() ?>][to]"
7878
id="gift-message-whole-to" title="<?= $block->escapeHtmlAttr(__('To')) ?>"
79-
value="<?= /* @noEscape */ $block->getEscaped($block->getMessage()->getRecipient() ?? '', $block->getDefaultTo()) ?>"
79+
value="<?= /* @noEscape */ $block->getEscaped($block->getMessage()->getRecipient(), $block->getDefaultTo()) ?>"
8080
class="input-text">
8181
</div>
8282
</div>
@@ -165,7 +165,7 @@ script;
165165
value=
166166
"<?= /* @noEscape */
167167
$block->getEscaped(
168-
$block->getMessage($_item)->getSender() ?? '',
168+
$block->getMessage($_item)->getSender(),
169169
$block->getDefaultFrom()
170170
) ?>" class="input-text">
171171
</div>
@@ -179,7 +179,7 @@ script;
179179
name="giftmessage[quote_item][<?= (int) $_item->getId() ?>][to]"
180180
id="gift-message-<?= (int) $_item->getId() ?>-to"
181181
title="<?= $block->escapeHtmlAttr(__('To')) ?>"
182-
value="<?= /* @noEscape */ $block->getEscaped($block->getMessage($_item)->getRecipient() ?? '', $block->getDefaultTo()) ?>"
182+
value="<?= /* @noEscape */ $block->getEscaped($block->getMessage($_item)->getRecipient(), $block->getDefaultTo()) ?>"
183183
class="input-text">
184184
</div>
185185
</div>
@@ -291,7 +291,7 @@ script;
291291
->getId() ?>][from]"
292292
id="gift-message-<?= (int) $block->getEntity()->getId() ?>-from"
293293
title="<?= $block->escapeHtmlAttr(__('From')) ?>"
294-
value="<?= /* @noEscape */ $block->getEscaped($block->getMessage()->getSender() ?? '', $block->getDefaultFrom()) ?>"
294+
value="<?= /* @noEscape */ $block->getEscaped($block->getMessage()->getSender(), $block->getDefaultFrom()) ?>"
295295
class="input-text">
296296
</div>
297297
</div>
@@ -304,7 +304,7 @@ script;
304304
->getId() ?>][to]"
305305
id="gift-message-<?= (int) $block->getEntity()->getId() ?>-to"
306306
title="<?= $block->escapeHtmlAttr(__('To')) ?>"
307-
value="<?= /* @noEscape */ $block->getEscaped($block->getMessage()->getRecipient() ?? '', $block->getDefaultTo()) ?>"
307+
value="<?= /* @noEscape */ $block->getEscaped($block->getMessage()->getRecipient(), $block->getDefaultTo()) ?>"
308308
class="input-text">
309309
</div>
310310
</div>
@@ -391,7 +391,7 @@ script;
391391
name="giftmessage[quote_address_item][<?= (int) $_item->getId()
392392
?>][from]" id="gift-message-<?= (int) $_item->getId() ?>-from"
393393
title="<?= $block->escapeHtmlAttr(__('From')) ?>"
394-
value="<?= /* @noEscape */ $block->getEscaped($block->getMessage($_item)->getSender() ?? '', $block->getDefaultFrom()) ?>"
394+
value="<?= /* @noEscape */ $block->getEscaped($block->getMessage($_item)->getSender(), $block->getDefaultFrom()) ?>"
395395
class="input-text">
396396
</div>
397397
</div>
@@ -404,7 +404,7 @@ script;
404404
name="giftmessage[quote_address_item][<?= (int) $_item->getId()
405405
?>][to]" id="gift-message-<?= (int) $_item->getId() ?>-to"
406406
title="<?= $block->escapeHtmlAttr(__('To')) ?>"
407-
value="<?= /* @noEscape */ $block->getEscaped($block->getMessage($_item)->getRecipient() ?? '', $block->getDefaultTo()) ?>"
407+
value="<?= /* @noEscape */ $block->getEscaped($block->getMessage($_item)->getRecipient(), $block->getDefaultTo()) ?>"
408408
class="input-text">
409409
</div>
410410
</div>

0 commit comments

Comments
 (0)