Skip to content

Commit d317e13

Browse files
author
Oleksandr Dubovyk
committed
Merge remote-tracking branch 'mainline/develop' into MAGETWO-66067
2 parents f03accf + c6d14d1 commit d317e13

File tree

24 files changed

+363
-135
lines changed

24 files changed

+363
-135
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ atlassian*
2525
/.grunt
2626
/Gruntfile.js
2727
/package.json
28+
/grunt-config.json
29+
/dev/tools/grunt/configs/local-themes.js
2830

2931
/pub/media/*.*
3032
!/pub/media/.htaccess

app/code/Magento/Backend/i18n/en_US.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ Minute,Minute
250250
"JavaScript may be disabled in your browser.","JavaScript may be disabled in your browser."
251251
"To use this website you must first enable JavaScript in your browser.","To use this website you must first enable JavaScript in your browser."
252252
"This is only a demo store. You can browse and place orders, but nothing will be processed.","This is only a demo store. You can browse and place orders, but nothing will be processed."
253-
"Report a Bug","Report a Bug"
253+
"Report an Issue","Report an Issue"
254254
"Store View:","Store View:"
255255
"Stores Configuration","Stores Configuration"
256256
"Please confirm scope switching. All data that hasn\'t been saved will be lost.","Please confirm scope switching. All data that hasn\'t been saved will be lost."

app/code/Magento/Backend/view/adminhtml/templates/page/report.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88

99
?>
1010
<?php if ($block->getBugreportUrl()): ?>
11-
<a class="link-report" href="<?php /* @escapeNotVerified */ echo $block->getBugreportUrl(); ?>" id="footer_bug_tracking"><?php /* @escapeNotVerified */ echo __('Report a Bug') ?></a>
11+
<a class="link-report" href="<?php /* @escapeNotVerified */ echo $block->getBugreportUrl(); ?>" id="footer_bug_tracking"><?php /* @escapeNotVerified */ echo __('Report an Issue') ?></a>
1212
<?php endif; ?>
Loading

app/code/Magento/CatalogSearch/Model/Layer/Filter/Attribute.php

Lines changed: 60 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function __construct(
5353
public function apply(\Magento\Framework\App\RequestInterface $request)
5454
{
5555
$attributeValue = $request->getParam($this->_requestVar);
56-
if (empty($attributeValue)) {
56+
if (empty($attributeValue) && !is_numeric($attributeValue)) {
5757
return $this;
5858
}
5959
$attribute = $this->getAttributeModel();
@@ -84,9 +84,10 @@ protected function _getItemsData()
8484
->getProductCollection();
8585
$optionsFacetedData = $productCollection->getFacetedData($attribute->getAttributeCode());
8686

87-
if (count($optionsFacetedData) === 0
88-
&& $this->getAttributeIsFilterable($attribute) !== static::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS
89-
) {
87+
$isAttributeFilterable =
88+
$this->getAttributeIsFilterable($attribute) === static::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS;
89+
90+
if (count($optionsFacetedData) === 0 && !$isAttributeFilterable) {
9091
return $this->itemDataBuilder->build();
9192
}
9293

@@ -95,28 +96,64 @@ protected function _getItemsData()
9596
$options = $attribute->getFrontend()
9697
->getSelectOptions();
9798
foreach ($options as $option) {
98-
if (empty($option['value'])) {
99-
continue;
100-
}
99+
$this->buildOptionData($option, $isAttributeFilterable, $optionsFacetedData, $productSize);
100+
}
101101

102-
$value = $option['value'];
102+
return $this->itemDataBuilder->build();
103+
}
103104

104-
$count = isset($optionsFacetedData[$value]['count'])
105-
? (int)$optionsFacetedData[$value]['count']
106-
: 0;
107-
// Check filter type
108-
if ($this->getAttributeIsFilterable($attribute) === static::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS
109-
&& (!$this->isOptionReducesResults($count, $productSize) || $count === 0)
110-
) {
111-
continue;
112-
}
113-
$this->itemDataBuilder->addItemData(
114-
$this->tagFilter->filter($option['label']),
115-
$value,
116-
$count
117-
);
105+
/**
106+
* Build option data
107+
*
108+
* @param array $option
109+
* @param boolean $isAttributeFilterable
110+
* @param array $optionsFacetedData
111+
* @param int $productSize
112+
* @return void
113+
*/
114+
private function buildOptionData($option, $isAttributeFilterable, $optionsFacetedData, $productSize)
115+
{
116+
$value = $this->getOptionValue($option);
117+
if ($value === false) {
118+
return;
119+
}
120+
$count = $this->getOptionCount($value, $optionsFacetedData);
121+
if ($isAttributeFilterable && (!$this->isOptionReducesResults($count, $productSize) || $count === 0)) {
122+
return;
118123
}
119124

120-
return $this->itemDataBuilder->build();
125+
$this->itemDataBuilder->addItemData(
126+
$this->tagFilter->filter($option['label']),
127+
$value,
128+
$count
129+
);
130+
}
131+
132+
/**
133+
* Retrieve option value if it exists
134+
*
135+
* @param array $option
136+
* @return bool|string
137+
*/
138+
private function getOptionValue($option)
139+
{
140+
if (empty($option['value']) && !is_numeric($option['value'])) {
141+
return false;
142+
}
143+
return $option['value'];
144+
}
145+
146+
/**
147+
* Retrieve count of the options
148+
*
149+
* @param int|string $value
150+
* @param array $optionsFacetedData
151+
* @return int
152+
*/
153+
private function getOptionCount($value, $optionsFacetedData)
154+
{
155+
return isset($optionsFacetedData[$value]['count'])
156+
? (int)$optionsFacetedData[$value]['count']
157+
: 0;
121158
}
122159
}

app/code/Magento/Directory/view/adminhtml/templates/js/optional_zip_countries.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ function setPostcodeOptional(zipElement, country) {
4040
zipElement.removeClassName('required-entry');
4141
}
4242
zipElement.up('div.field').removeClassName('required');
43+
zipElement.up('div.field').removeClassName('_required');
4344
} else {
4445
zipElement.addClassName('required-entry');
4546
zipElement.up('div.field').addClassName('required');

app/code/Magento/ImportExport/Model/Import/ErrorProcessing/ProcessingErrorAggregator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ public function clear()
325325
$this->items = [];
326326
$this->errorStatistics = [];
327327
$this->invalidRows = [];
328+
$this->skippedRows = [];
328329

329330
return $this;
330331
}

app/code/Magento/NewRelicReporting/etc/di.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
9-
<preference for="Magento\Framework\Module\ModuleListInterface" type="Magento\Framework\Module\ModuleList" />
109
<type name="Magento\NewRelicReporting\Model\Module\Collect">
1110
<arguments>
1211
<argument name="fullModuleList" xsi:type="object">Magento\Framework\Module\FullModuleList</argument>

app/code/Magento/Paypal/Model/Api/Nvp.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,9 +1482,9 @@ protected function _exportAddressses($data)
14821482
protected function _applyStreetAndRegionWorkarounds(\Magento\Framework\DataObject $address)
14831483
{
14841484
// merge street addresses into 1
1485-
if ($address->hasStreet2()) {
1486-
$address->setStreet(implode("\n", [$address->getStreet(), $address->getStreetLine(2)]));
1487-
$address->unsStreet2();
1485+
if ($address->getData('street2') !== null) {
1486+
$address->setStreet(implode("\n", [$address->getData('street'), $address->getData('street2')]));
1487+
$address->unsetData('street2');
14881488
}
14891489
// attempt to fetch region_id from directory
14901490
if ($address->getCountryId() && $address->getRegion()) {

app/code/Magento/Paypal/Model/Express/Checkout.php

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -900,35 +900,19 @@ public function getCheckoutMethod()
900900
* @param Address $address
901901
* @param array $exportedAddress
902902
* @return void
903-
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
904903
*/
905904
protected function _setExportedAddressData($address, $exportedAddress)
906905
{
907906
// Exported data is more priority if we came from Express Checkout button
908-
$isButton = (bool)$this->_quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_BUTTON);
907+
$isButton = (bool)$this->_quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_BUTTON);
909908
if (!$isButton) {
910-
foreach ($exportedAddress->getExportedKeys() as $key) {
911-
$oldData = $address->getDataUsingMethod($key);
912-
$isEmpty = null;
913-
if (is_array($oldData)) {
914-
foreach ($oldData as $val) {
915-
if (!empty($val)) {
916-
$isEmpty = false;
917-
break;
918-
}
919-
$isEmpty = true;
920-
}
921-
}
922-
if (empty($oldData) || $isEmpty === true) {
923-
$address->setDataUsingMethod($key, $exportedAddress->getData($key));
924-
}
925-
}
926-
} else {
927-
foreach ($exportedAddress->getExportedKeys() as $key) {
928-
$data = $exportedAddress->getData($key);
929-
if (!empty($data)) {
930-
$address->setDataUsingMethod($key, $data);
931-
}
909+
return;
910+
}
911+
912+
foreach ($exportedAddress->getExportedKeys() as $key) {
913+
$data = $exportedAddress->getData($key);
914+
if (!empty($data)) {
915+
$address->setDataUsingMethod($key, $data);
932916
}
933917
}
934918
}

0 commit comments

Comments
 (0)