Skip to content

Commit

Permalink
Merge pull request #1625 from magento-engcom/2.2-develop-prs
Browse files Browse the repository at this point in the history
[EngCom] Public Pull Requests - 2.2-develop
 - MAGETWO-82724 Allow coupon code with special charater to be applied to order in checkout #11710
 - MAGETWO-82675 Add a health check to the NGINX configuration sample #11690
 - MAGETWO-82562 Coupon codes not showing in invoice #11635
 - MAGETWO-82535 Fixed ability to set field config from layout xml #11302 [backport 2.2] #11643
 - MAGETWO-81146 Fixing #10275 keyboard submit of adminhtml suggest form. #11250
 - MAGETWO-82761 [Backport 2.2-develop] Dashboard Fix Y Axis for range #11751
 - MAGETWO-82748 Fix Notice: freePackageValue is undefined #11720
 - MAGETWO-82747 [TASK] Updated user.ini according to Magento DevDocs #11734
 - MAGETWO-82537 MAGETWO-81311: Check the length of the array before attempting to sli… #11637
 - MAGETWO-81970 Add missing translations in Magento_UI #11440
 - MAGETWO-81904 FIX #11022 in 2.2-develop: Filter Groups of search criteria parameter have not been included for further processing #11421
 - MAGETWO-82179 Fix Filter Customer Report Review 2.2-develop [Backport] #11522
  • Loading branch information
ishakhsuvarov authored Oct 26, 2017
2 parents 08f0056 + 30746ae commit 04140ba
Show file tree
Hide file tree
Showing 19 changed files with 112 additions and 45 deletions.
4 changes: 2 additions & 2 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
############################################
## adjust memory limit

php_value memory_limit 768M
php_value memory_limit 756M
php_value max_execution_time 18000

############################################
Expand All @@ -59,7 +59,7 @@
############################################
## adjust memory limit

php_value memory_limit 768M
php_value memory_limit 756M
php_value max_execution_time 18000

############################################
Expand Down
2 changes: 1 addition & 1 deletion .htaccess.sample
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
############################################
## adjust memory limit

php_value memory_limit 768M
php_value memory_limit 756M
php_value max_execution_time 18000

############################################
Expand Down
2 changes: 1 addition & 1 deletion .user.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
memory_limit = 768M
memory_limit = 756M
max_execution_time = 18000
session.auto_start = off
suhosin.session.cryptua = off
2 changes: 2 additions & 0 deletions app/code/Magento/Backend/Block/Dashboard/Graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,8 @@ public function getChartUrl($directUrl = true)
$tmpstring = implode('|', $this->_axisLabels[$idx]);

$valueBuffer[] = $indexid . ":|" . $tmpstring;
} elseif ($idx == 'y') {
$valueBuffer[] = $indexid . ":|" . implode('|', $yLabels);
}
$indexid++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public function save(\Magento\Eav\Api\Data\AttributeSetInterface $attributeSet)
*/
public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria)
{
$this->searchCriteriaBuilder->setFilterGroups((array)$searchCriteria->getFilterGroups());
$this->searchCriteriaBuilder->addFilters(
[
$this->filterBuilder
Expand All @@ -71,9 +72,15 @@ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCr
->create(),
]
);

$this->searchCriteriaBuilder->setSortOrders((array)$searchCriteria->getSortOrders());
$this->searchCriteriaBuilder->setCurrentPage($searchCriteria->getCurrentPage());
$this->searchCriteriaBuilder->setPageSize($searchCriteria->getPageSize());
return $this->attributeSetRepository->getList($this->searchCriteriaBuilder->create());

$searchResult = $this->attributeSetRepository->getList($this->searchCriteriaBuilder->create());
$searchResult->setSearchCriteria($searchCriteria);

return $searchResult;
}

/**
Expand Down
27 changes: 13 additions & 14 deletions app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,20 +168,19 @@ protected function getFieldConfig(

$element = [
'component' => isset($additionalConfig['component']) ? $additionalConfig['component'] : $uiComponent,
'config' => [
// customScope is used to group elements within a single form (e.g. they can be validated separately)
'customScope' => $dataScopePrefix,
'customEntry' => isset($additionalConfig['config']['customEntry'])
? $additionalConfig['config']['customEntry']
: null,
'template' => 'ui/form/field',
'elementTmpl' => isset($additionalConfig['config']['elementTmpl'])
? $additionalConfig['config']['elementTmpl']
: $elementTemplate,
'tooltip' => isset($additionalConfig['config']['tooltip'])
? $additionalConfig['config']['tooltip']
: null
],
'config' => $this->mergeConfigurationNode(
'config',
$additionalConfig,
[
'config' => [
// customScope is used to group elements within a single
// form (e.g. they can be validated separately)
'customScope' => $dataScopePrefix,
'template' => 'ui/form/field',
'elementTmpl' => $elementTemplate,
],
]
),
'dataScope' => $dataScopePrefix . '.' . $attributeCode,
'label' => $attributeConfig['label'],
'provider' => $providerName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ define([
quoteId: quoteId
} : {},
urls = {
'guest': '/guest-carts/' + quoteId + '/coupons/' + couponCode,
'customer': '/carts/mine/coupons/' + couponCode
'guest': '/guest-carts/' + quoteId + '/coupons/' + encodeURIComponent(couponCode),
'customer': '/carts/mine/coupons/' + encodeURIComponent(couponCode)
};

return this.getUrl(urls, params);
Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ public function collectRates(RateRequest $request)

// Free shipping by qty
$freeQty = 0;
$freePackageValue = 0;

if ($request->getAllItems()) {
$freePackageValue = 0;
foreach ($request->getAllItems() as $item) {
if ($item->getProduct()->isVirtual() || $item->getParentItem()) {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,21 @@ protected function _joinCustomers()
return $this;
}

/**
* {@inheritdoc}
*
* Additional processing of 'customer_name' field is required, as it is a concat field, which can not be aliased.
* @see _joinCustomers
*/
public function addFieldToFilter($field, $condition = null)
{
if ($field === 'customer_name') {
$field = $this->getConnection()->getConcatSql(['customer.firstname', 'customer.lastname'], ' ');
}

return parent::addFieldToFilter($field, $condition);
}

/**
* Get select count sql
*
Expand Down
6 changes: 6 additions & 0 deletions app/code/Magento/Sales/etc/fieldset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,12 @@
<aspect name="to_quote_address_shipping" />
<aspect name="to_cm"/>
</field>
<field name="discount_description">
<aspect name="to_quote" />
<aspect name="to_invoice" />
<aspect name="to_shipment" />
<aspect name="to_cm" />
</field>
<field name="shipping_amount">
<aspect name="to_quote_address_shipping" />
<aspect name="to_cm"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ private function updateMemoryLimit()
if (function_exists('ini_set')) {
@ini_set('display_errors', 1);
$memoryLimit = trim(ini_get('memory_limit'));
if ($memoryLimit != -1 && $this->getMemoryInBytes($memoryLimit) < 768 * 1024 * 1024) {
@ini_set('memory_limit', '768M');
if ($memoryLimit != -1 && $this->getMemoryInBytes($memoryLimit) < 756 * 1024 * 1024) {
@ini_set('memory_limit', '756M');
}
}
}
Expand Down
22 changes: 22 additions & 0 deletions app/code/Magento/Ui/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,25 @@ settings/addAfter,settings/addAfter
Action,Action
CSV,CSV
"Excel XML","Excel XML"
"Please select one of the options above.","Please select one of the options above."
"Please select a file.","Please select a file."
"Please select one of the options.","Please select one of the options."
"Please enter a value less than or equal to %s.","Please enter a value less than or equal to %s."
"Please enter a value greater than or equal to %s.","Please enter a value greater than or equal to %s."
"Card type does not match credit card number.","Card type does not match credit card number."
"Credit card number does not match credit card type.","Credit card number does not match credit card type."
"Incorrect credit card expiration date.","Incorrect credit card expiration date."
"Please enter less or equal than %1 symbols.","Please enter less or equal than %1 symbols."
"Please enter more or equal than %1 symbols.","Please enter more or equal than %1 symbols."
"Please enter a valid value from list","Please enter a valid value from list"
"Please enter valid SKU key.","Please enter valid SKU key."
"Please enter a valid number.","Please enter a valid number."
"Admin is a required field in the each row.","Admin is a required field in the each row."
"Please fix this field.","Please fix this field."
"Please enter a valid date (ISO).","Please enter a valid date (ISO)."
"Please enter only digits.","Please enter only digits."
"Please enter the same value again.","Please enter the same value again."
"Please enter no more than {0} characters.","Please enter no more than {0} characters."
"Please enter at least {0} characters.","Please enter at least {0} characters."
"Please enter a value between {0} and {1} characters long.","Please enter a value between {0} and {1} characters long."
"Please enter a value between {0} and {1}.","Please enter a value between {0} and {1}."
4 changes: 2 additions & 2 deletions app/code/Magento/Ui/view/base/web/js/form/element/abstract.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ define([

this._super();

scope = this.dataScope;
name = scope.split('.').slice(1);
scope = this.dataScope.split('.');
name = scope.length > 1 ? scope.slice(1) : scope;

valueUpdate = this.showFallbackReset ? 'afterkeydown' : this.valueUpdate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,9 @@ public function testGetList()
{
$searchCriteria = [
'searchCriteria' => [
'filter_groups' => [
[
'filters' => [
[
'field' => 'entity_type_code',
'value' => 'catalog_product',
'condition_type' => 'eq',
],
],
],
],
'filter_groups' => [],
'current_page' => 1,
'page_size' => 2,
'page_size' => 2
],
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected function setUp()
*/
public function testSelectCountSql()
{
$this->collection->addFieldToFilter('customer_name', ['like' => '%john%']);
$this->collection->addFieldToFilter('customer_name', ['like' => '%John%'])->getItems();
$this->assertEquals(1, $this->collection->getSize());
}
}
25 changes: 25 additions & 0 deletions lib/web/mage/backend/suggest.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@

case keyCode.ENTER:
case keyCode.NUMPAD_ENTER:
this._toggleEnter(event);

if (this.isDropdownShown() && this._focused) {
this._proxyEvents(event);
Expand Down Expand Up @@ -314,6 +315,30 @@
this._bindDropdown();
},

/**
* @param {Object} event - event object
* @private
*/
_toggleEnter: function (event) {
var suggestList,
activeItems,
selectedItem;

suggestList = $(event.currentTarget.parentNode).find('ul').first();
activeItems = suggestList.find('._active');

if (activeItems.length >= 0) {
selectedItem = activeItems.first();

if (selectedItem.find('a') && selectedItem.find('a').attr('href') !== undefined) {
window.location = selectedItem.find('a').attr('href');
event.preventDefault();

return false;
}
}
},

/**
* @param {Object} e - event object
* @private
Expand Down
6 changes: 3 additions & 3 deletions nginx.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ location ~* ^/setup($|/) {
fastcgi_pass fastcgi_backend;

fastcgi_param PHP_FLAG "session.auto_start=off \n suhosin.session.cryptua=off";
fastcgi_param PHP_VALUE "memory_limit=768M \n max_execution_time=600";
fastcgi_param PHP_VALUE "memory_limit=756M \n max_execution_time=600";
fastcgi_read_timeout 600s;
fastcgi_connect_timeout 600s;

Expand Down Expand Up @@ -162,13 +162,13 @@ location /media/import/ {
}

# PHP entry point for main application
location ~ (index|get|static|report|404|503)\.php$ {
location ~ (index|get|static|report|404|503|health_check)\.php$ {
try_files $uri =404;
fastcgi_pass fastcgi_backend;
fastcgi_buffers 1024 4k;

fastcgi_param PHP_FLAG "session.auto_start=off \n suhosin.session.cryptua=off";
fastcgi_param PHP_VALUE "memory_limit=768M \n max_execution_time=18000";
fastcgi_param PHP_VALUE "memory_limit=756M \n max_execution_time=18000";
fastcgi_read_timeout 600s;
fastcgi_connect_timeout 600s;

Expand Down
4 changes: 2 additions & 2 deletions pub/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
############################################
## Adjust memory limit

php_value memory_limit 768M
php_value memory_limit 756M
php_value max_execution_time 18000

############################################
Expand All @@ -60,7 +60,7 @@
############################################
## Adjust memory limit

php_value memory_limit 768M
php_value memory_limit 756M
php_value max_execution_time 18000

############################################
Expand Down
2 changes: 1 addition & 1 deletion pub/.user.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
memory_limit = 768M
memory_limit = 756M
max_execution_time = 18000
session.auto_start = off
suhosin.session.cryptua = off

0 comments on commit 04140ba

Please sign in to comment.