Skip to content

Commit

Permalink
Merge pull request #1586 from magento-engcom/develop-prs
Browse files Browse the repository at this point in the history
Public Pull Requests:

#11362
#11296
#11234
#11206
#11153
#10923
  • Loading branch information
Oleksii Korshenko committed Oct 12, 2017
2 parents 45d1d93 + f21a58e commit cb93fe5
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,14 @@ public function setCollection($collection)
$this->_collection->setPageSize($limit);
}
if ($this->getCurrentOrder()) {
$this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
if (($this->getCurrentOrder()) == 'position') {
$this->_collection->addAttributeToSort(
$this->getCurrentOrder(),
$this->getCurrentDirection()
)->addAttributeToSort('entity_id', $this->getCurrentDirection());
} else {
$this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
}
}
return $this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function processDeletedImages($product, array &$images)
$catalogPath = $this->mediaConfig->getBaseMediaPath();
$isFile = $this->mediaDirectory->isFile($catalogPath . $image['file']);
// only delete physical files if they are not used by any other products and if this file exist
if (!($this->resourceModel->countImageUses($image['file']) > 1) && $isFile) {
if ($isFile && !($this->resourceModel->countImageUses($image['file']) > 1)) {
$filesToDelete[] = ltrim($image['file'], '/');
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Magento\Sales\Api\OrderRepositoryInterface;
use Magento\Sales\Api\Data\OrderAddressInterface;
use Magento\Sales\Controller\Adminhtml\Order;
use Magento\Sales\Model\Order\Address;
use Magento\Sales\Model\Order\Address as AddressModel;
use Psr\Log\LoggerInterface;
use Magento\Framework\Registry;
use Magento\Framework\App\Response\Http\FileFactory;
Expand Down Expand Up @@ -97,7 +97,7 @@ public function __construct(
public function execute()
{
$addressId = $this->getRequest()->getParam('address_id');
/** @var $address OrderAddressInterface|Address */
/** @var $address OrderAddressInterface|AddressModel */
$address = $this->_objectManager->create(
OrderAddressInterface::class
)->load($addressId);
Expand Down
11 changes: 11 additions & 0 deletions app/code/Magento/Store/Api/Data/StoreInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ public function setWebsiteId($websiteId);
*/
public function getStoreGroupId();

/**
* @param int $isActive
* @return $this
*/
public function setIsActive($isActive);

/**
* @return int
*/
public function getIsActive();

/**
* @param int $storeGroupId
* @return $this
Expand Down
17 changes: 16 additions & 1 deletion app/code/Magento/Store/Model/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
* @method int getSortOrder()
* @method int getStoreId()
* @method Store setSortOrder($value)
* @method Store setIsActive($value)
*
* @SuppressWarnings(PHPMD.TooManyFields)
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
Expand Down Expand Up @@ -1088,6 +1087,22 @@ public function setStoreGroupId($storeGroupId)
return $this->setGroupId($storeGroupId);
}

/**
* @inheritdoc
*/
public function getIsActive()
{
return $this->_getData('is_active');
}

/**
* @inheritdoc
*/
public function setIsActive($isActive)
{
return $this->setData('is_active', $isActive);
}

/**
* Retrieve default group identifier
*
Expand Down
4 changes: 4 additions & 0 deletions app/code/Magento/Store/etc/cache.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,8 @@
<label>Database DDL operations</label>
<description>Results of DDL queries, such as describing tables or indexes</description>
</type>
<type name="compiled_config" translate="label,description" instance="Magento\Framework\App\Interception\Cache\CompiledConfig">
<label>Compiled Config</label>
<description>Compliation configuration</description>
</type>
</config>
2 changes: 2 additions & 0 deletions app/code/Magento/Store/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ Layouts,Layouts
"API interfaces reflection data","API interfaces reflection data"
"Database DDL operations","Database DDL operations"
"Results of DDL queries, such as describing tables or indexes","Results of DDL queries, such as describing tables or indexes"
"Compiled Config","Compiled Config"
"Compliation configuration","Compliation configuration"
18 changes: 9 additions & 9 deletions app/code/Magento/Wishlist/Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ class Config
/**
* @var \Magento\Catalog\Model\Config
*/
private $_catalogConfig;
private $catalogConfig;

/**
* @var \Magento\Catalog\Model\Attribute\Config
*/
private $_attributeConfig;
private $attributeConfig;

/**
* Number of emails allowed for sharing wishlist
*
* @var int
*/
private $_sharingEmailLimit;
private $sharingEmailLimit;

/**
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
Expand All @@ -54,10 +54,10 @@ public function __construct(
self::XML_PATH_SHARING_TEXT_LIMIT,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
$this->_sharingEmailLimit = $emailLimitInConfig ?: self::SHARING_EMAIL_LIMIT;
$this->sharingEmailLimit = $emailLimitInConfig ?: self::SHARING_EMAIL_LIMIT;
$this->_sharignTextLimit = $textLimitInConfig ?: self::SHARING_TEXT_LIMIT;
$this->_catalogConfig = $catalogConfig;
$this->_attributeConfig = $attributeConfig;
$this->catalogConfig = $catalogConfig;
$this->attributeConfig = $attributeConfig;
}

/**
Expand All @@ -67,8 +67,8 @@ public function __construct(
*/
public function getProductAttributes()
{
$catalogAttributes = $this->_catalogConfig->getProductAttributes();
$wishlistAttributes = $this->_attributeConfig->getAttributeNames('wishlist_item');
$catalogAttributes = $this->catalogConfig->getProductAttributes();
$wishlistAttributes = $this->attributeConfig->getAttributeNames('wishlist_item');
return array_merge($catalogAttributes, $wishlistAttributes);
}

Expand All @@ -79,7 +79,7 @@ public function getProductAttributes()
*/
public function getSharingEmailLimit()
{
return $this->_sharingEmailLimit;
return $this->sharingEmailLimit;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function testGetList()
$storeViews = $this->_webApiCall($serviceInfo, $requestData);
$this->assertNotNull($storeViews);
$this->assertGreaterThan(1, count($storeViews));
$keys = ['id', 'code', 'name', 'website_id', 'store_group_id'];
$keys = ['id', 'code', 'name', 'website_id', 'store_group_id', 'is_active'];
$this->assertEquals($keys, array_keys($storeViews[0]));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<testCase name="Magento\Customer\Test\TestCase\CreateExistingCustomerBackendEntity" summary="Create Existing Customer from Backend" ticketId="MAGETWO-43685">
<variation name="CreateExistingCustomerBackendEntity1" summary="Create existing customer on Backend.">
<data name="customer/dataset" xsi:type="string">default</data>
<data name="issue" xsi:type="string">MAGETWO-81744: [Jenkins] Random fail of Requisition List Test and CreateExistingCustomerBackendEntity</data>
<constraint name="Magento\Customer\Test\Constraint\AssertCustomerBackendDuplicateErrorMessage" />
</variation>
</testCase>
Expand Down
1 change: 1 addition & 0 deletions dev/tests/static/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
</testsuites>
<php>
<ini name="date.timezone" value="America/Los_Angeles"/>
<const name="TESTCODESTYLE_IS_FULL_SCAN" value="1"/>
<!-- TESTS_COMPOSER_PATH - specify the path to composer binary, if a relative reference cannot be resolved -->
<!--<const name="TESTS_COMPOSER_PATH" value="/usr/local/bin/composer"/>-->
</php>
Expand Down
5 changes: 4 additions & 1 deletion dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,14 @@ private function getFullWhitelist()

public function testCodeStyle()
{
$whiteList = defined('TESTCODESTYLE_IS_FULL_SCAN') && TESTCODESTYLE_IS_FULL_SCAN === '1'
? $this->getFullWhitelist() : self::getWhitelist(['php', 'phtml']);

$reportFile = self::$reportDir . '/phpcs_report.txt';
$codeSniffer = new CodeSniffer('Magento', $reportFile, new Wrapper());
$this->assertEquals(
0,
$result = $codeSniffer->run($this->getFullWhitelist()),
$result = $codeSniffer->run($whiteList),
"PHP Code Sniffer detected {$result} violation(s): " . PHP_EOL . file_get_contents($reportFile)
);
}
Expand Down

0 comments on commit cb93fe5

Please sign in to comment.