Skip to content

Commit ff3d130

Browse files
committed
Merge remote-tracking branch 'origin/AC-3108-fix-deprecation-issues-part5' into delivery-bunch-w21
2 parents 8047729 + ddb8d87 commit ff3d130

File tree

16 files changed

+33
-26
lines changed

16 files changed

+33
-26
lines changed

app/code/Magento/Persistent/Model/Persistent/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function setConfigFilePath($path)
106106
protected function _getConfigDomXPath()
107107
{
108108
if ($this->_configDomXPath === null) {
109-
$dir = explode("/", $this->_configFilePath);
109+
$dir = $this->_configFilePath !== null ? explode("/", $this->_configFilePath) : [];
110110
array_pop($dir);
111111
$dir = implode("/", $dir);
112112
$directoryRead = $this->readFactory->create($dir);

app/code/Magento/ProductAlert/Controller/Add/Price.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function __construct(
6161
*/
6262
protected function isInternal($url)
6363
{
64-
if (strpos($url, 'http') === false) {
64+
if ($url === null || strpos($url, 'http') === false) {
6565
return false;
6666
}
6767
$currentStore = $this->storeManager->getStore();

app/code/Magento/Quote/Model/ResourceModel/Quote/Address/Attribute/Frontend/Discount.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function fetchTotals(\Magento\Quote\Model\Quote\Address $address)
2424
if ($amount != 0) {
2525
$title = __('Discount');
2626
$couponCode = $address->getQuote()->getCouponCode();
27-
if (strlen($couponCode)) {
27+
if ($couponCode !== null && strlen($couponCode)) {
2828
$title .= sprintf(' (%s)', $couponCode);
2929
}
3030
$address->addTotal(['code' => 'discount', 'title' => $title, 'value' => -$amount]);

app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Multiple.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function getData(
5555
SelectedOption $selectedOption
5656
): array {
5757
$selectedOptionValueData = [];
58-
$optionIds = explode(',', $selectedOption->getValue());
58+
$optionIds = $selectedOption->getValue() !== null ? explode(',', $selectedOption->getValue()) : [];
5959

6060
if (0 === count($optionIds)) {
6161
return $selectedOptionValueData;

app/code/Magento/QuoteGraphQl/Model/Resolver/CartPrices.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ private function getDiscount(Total $total, string $currency)
130130
return null;
131131
}
132132
return [
133-
'label' => explode(', ', $total->getDiscountDescription()),
133+
'label' => $total->getDiscountDescription() !== null ? explode(', ', $total->getDiscountDescription()) : [],
134134
'amount' => ['value' => $total->getDiscountAmount(), 'currency' => $currency]
135135
];
136136
}

app/code/Magento/QuoteGraphQl/Model/Resolver/CustomizableOptions.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
5151
}
5252

5353
$customizableOptionsData = [];
54-
$customizableOptionIds = explode(',', $quoteItemOption->getValue());
54+
$customizableOptionIds = $quoteItemOption->getValue() !== null ?
55+
explode(',', $quoteItemOption->getValue()) : [];
5556

5657
foreach ($customizableOptionIds as $customizableOptionId) {
5758
$customizableOption = $this->customizableOption->getData(

app/code/Magento/QuoteGraphQl/Test/Unit/Model/Resolver/CartPricesTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ public function testResolve(): void
124124
->expects($this->once())
125125
->method('getSubtotalInclTax');
126126
$this->totalMock
127-
->expects($this->once())
128127
->method('getDiscountDescription')
129128
->willReturn('Discount Description');
130129
$this->totalMock

app/code/Magento/ReleaseNotification/Ui/DataProvider/Modifier/Notifications.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ private function getNotificationContent()
197197
{
198198
$version = strtolower($this->getTargetVersion());
199199
$edition = strtolower($this->productMetadata->getEdition());
200-
$locale = strtolower($this->session->getUser()->getInterfaceLocale());
200+
$locale = $this->session->getUser()->getInterfaceLocale();
201+
$locale = $locale !== null ? strtolower($locale) : '';
201202

202203
$cacheKey = self::$cachePrefix . $version . "-" . $edition . "-" . $locale;
203204
$modalContent = $this->cacheStorage->load($cacheKey);

app/code/Magento/ReleaseNotification/Ui/Renderer/NotificationRenderer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ private function buildSubHeadings(array $subHeadings)
146146
$content .= $this->escaper->escapeHtml($subHeading['title']);
147147
$content .= "</h3>";
148148
$content .= "<p>";
149-
$content .= $this->formatContentWithLinks($subHeading['content']);
149+
$content .= isset($subHeading['content']) ? $this->formatContentWithLinks($subHeading['content']) : '';
150150
$content .= "</p>";
151151
$content .= "</div>";
152152
}
@@ -170,6 +170,8 @@ private function buildFooter(array $footer)
170170
}
171171

172172
/**
173+
* Formats links in the content to a correct format.
174+
*
173175
* Searches a given string for a URL, formats it to an HTML anchor tag, and returns the original string in the
174176
* correct HTML format.
175177
*

app/code/Magento/Tax/Model/TaxClass/Repository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ protected function validateTaxClassData(\Magento\Tax\Api\Data\TaxClassInterface
184184
}
185185

186186
$classType = $taxClass->getClassType();
187-
if (!\Zend_Validate::is(trim($classType), 'NotEmpty')) {
187+
if (!\Zend_Validate::is($classType !== null ? trim($classType) : '', 'NotEmpty')) {
188188
$exception->addError(
189189
__('"%fieldName" is required. Enter and try again.', ['fieldName' => ClassModel::KEY_TYPE])
190190
);

0 commit comments

Comments
 (0)