Skip to content

Commit

Permalink
[EngCom] Public Pull Requests - 2.3-develop
Browse files Browse the repository at this point in the history
 - merged latest code from mainline branch
  • Loading branch information
magento-engcom-team authored Sep 25, 2018
2 parents ad124d3 + 547ad4a commit 25285a3
Show file tree
Hide file tree
Showing 54 changed files with 504 additions and 320 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2.3.0
=============
To get detailed information about changes in Magento 2.3.0, see the [Release Notes](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html)

2.1.0
=============
To get detailed information about changes in Magento 2.1.0, please visit [Magento Community Edition (CE) Release Notes](http://devdocs.magento.com/guides/v2.1/release-notes/ReleaseNotes2.1.0CE.html "Magento Community Edition (CE) Release Notes")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<?php
/**
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Backend\Controller\Adminhtml\System\Store;

use Magento\Framework\App\Action\HttpPostActionInterface;
use Magento\Framework\Controller\ResultFactory;

class DeleteGroupPost extends \Magento\Backend\Controller\Adminhtml\System\Store
/**
* Delete store.
*/
class DeleteGroupPost extends \Magento\Backend\Controller\Adminhtml\System\Store implements HttpPostActionInterface
{
/**
* @inheritDoc
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function execute()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<?php
/**
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Backend\Controller\Adminhtml\System\Store;

use Magento\Framework\App\Action\HttpPostActionInterface;
use Magento\Framework\Controller\ResultFactory;

class DeleteStorePost extends \Magento\Backend\Controller\Adminhtml\System\Store
/**
* Delete store view.
*/
class DeleteStorePost extends \Magento\Backend\Controller\Adminhtml\System\Store implements HttpPostActionInterface
{
/**
* Delete store view post action
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
use Magento\Framework\Controller\ResultFactory;

/**
* Delete website.
*/
class DeleteWebsitePost extends \Magento\Backend\Controller\Adminhtml\System\Store implements HttpPostActionInterface
{
/**
* @inheritDoc
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function execute()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
<severity value="CRITICAL"/>
<testCaseId value="MAGETWO-94176"/>
<group value="backup"/>
<group value="skip"/>
<skip>
<issueId value="MQE-1187"/>
<issueId value="DEVOPS-3512"/>
</skip>
</annotations>

<!--Login to admin area-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
*/
namespace Magento\Catalog\Controller\Adminhtml\Category\Image;

use Magento\Framework\App\Action\HttpPostActionInterface;
use Magento\Framework\Controller\ResultFactory;

/**
* Class Upload
*/
class Upload extends \Magento\Backend\App\Action
class Upload extends \Magento\Backend\App\Action implements HttpPostActionInterface
{
/**
* Image uploader
Expand Down Expand Up @@ -54,14 +55,6 @@ public function execute()

try {
$result = $this->imageUploader->saveFileToTmpDir($imageId);

$result['cookie'] = [
'name' => $this->_getSession()->getName(),
'value' => $this->_getSession()->getSessionId(),
'lifetime' => $this->_getSession()->getCookieLifetime(),
'path' => $this->_getSession()->getCookiePath(),
'domain' => $this->_getSession()->getCookieDomain(),
];
} catch (\Exception $e) {
$result = ['error' => $e->getMessage(), 'errorcode' => $e->getCode()];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<element name="Height" type="input" selector=".mce-textbox.mce-abs-layout-item.mce-first" />
<element name="UploadImage" type="file" selector=".fileupload" />
<element name="OkBtn" type="button" selector="//span[text()='Ok']"/>
<element name="InsertFile" type="text" selector="#insert_files"/>
<element name="InsertFile" type="text" selector="#insert_files" timeout="30"/>
<element name="CreateFolder" type="button" selector="#new_folder" />
<element name="DeleteSelectedBtn" type="text" selector="#delete_files"/>
<element name="CancelBtn" type="button" selector="#cancel" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,25 @@
<severity value="CRITICAL"/>
<testCaseId value="MC-194"/>
<group value="Catalog"/>
<skip>
<issueId value="MAGETWO-92780"/>
</skip>
</annotations>
<before>
<createData entity="productDropDownAttribute" stepKey="attribute"/>

<createData entity="productAttributeOption1" stepKey="option1">
<requiredEntity createDataKey="attribute"/>
</createData>
<createData entity="productAttributeOption2" stepKey="option2">
<requiredEntity createDataKey="attribute"/>
</createData>

<createData entity="AddToDefaultSet" stepKey="addToDefaultSet">
<requiredEntity createDataKey="attribute"/>
</createData>

<createData entity="ApiProductWithDescription" stepKey="product"/>

<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
<deleteData createDataKey="attribute" stepKey="deleteAttribute"/>
<actionGroup ref="logout" stepKey="logout"/>
</after>

<!-- Assert attribute presence in storefront product additional information -->
<amOnPage url="/$$product.custom_attributes[url_key]$$.html" stepKey="onProductPage1"/>
<waitForPageLoad stepKey="wait1"/>
Expand All @@ -64,6 +56,8 @@
<see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassigned"/>
<!-- Save attribute set -->
<actionGroup ref="SaveAttributeSet" stepKey="SaveAttributeSet"/>
<!-- Clear cache -->
<actionGroup ref="ClearPageCacheActionGroup" stepKey="clearPageCacheActionGroup"/>
<!-- Go to create new product page -->
<amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToNewProduct"/>
<waitForPageLoad stepKey="wait2"/>
Expand All @@ -72,8 +66,7 @@
<!-- Assert removed attribute not presence in storefront product additional information -->
<amOnPage url="/$$product.custom_attributes[url_key]$$.html" stepKey="onProductPage2"/>
<waitForPageLoad stepKey="wait3"/>
<actionGroup ref="checkAttributeNotInMoreInformationTab" stepKey="checkAttributeNotInMoreInformationTab">
<argument name="attributeLabel" value="$$attribute.attribute[frontend_labels][0][label]$$"/>
</actionGroup>
<dontSeeElement selector="{{StorefrontProductMoreInformationSection.moreInformation}}" stepKey="dontSeeProductAttribute"/>
<dontSee userInput="$$attribute.attribute[frontend_labels][0][label]$$" selector="{{StorefrontProductMoreInformationSection.moreInformationTextArea}}" stepKey="dontSeeAttributeLabel"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
<severity value="CRITICAL"/>
<group value="product"/>
<testCaseId value="MAGETWO-92384"/>
<group value="skip"/>
<skip>
<issueId value="MAGETWO-93261"/>
</skip>
</annotations>
<before>
<createData entity="_defaultCategory" stepKey="createCategory"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
<description value="Admin should be able to see the full title of the selected custom option value in the order"/>
<severity value="MAJOR"/>
<testCaseId value="MC-3043"/>
<group value="skip"/>
<!-- Skip due to MQE-1128 -->
<skip>
<issueId value="MQE-1128"/>
</skip>
</annotations>
<before>
<!--Create Simple Product with Custom Options-->
Expand Down Expand Up @@ -106,6 +101,6 @@
</assertEquals>
<moveMouseOver selector="{{AdminOrderItemsOrderedSection.productNameOptions}} dd" stepKey="hoverProduct"/>
<waitForElementVisible selector="{{AdminOrderItemsOrderedSection.productNameOptions}} dd:nth-child(2)" stepKey="waitForCustomOptionValueFullName"/>
<see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="{{ProductOptionValueDropdownLongTitle1.title}}" stepKey="seeAdminOrderProductOptionValueDropdown1"/>
<see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj111 11Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj11111" stepKey="seeAdminOrderProductOptionValueDropdown1"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -2839,7 +2839,7 @@ protected function getProductUrlSuffix($storeId = null)
protected function getUrlKey($rowData)
{
if (!empty($rowData[self::URL_KEY])) {
return strtolower($rowData[self::URL_KEY]);
return $this->productUrl->formatUrlKey($rowData[self::URL_KEY]);
}

if (!empty($rowData[self::COL_NAME])) {
Expand Down
80 changes: 69 additions & 11 deletions app/code/Magento/Cms/Block/Widget/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\Cms\Block\Widget;

use Magento\Framework\DataObject\IdentityInterface;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Cms\Model\Block as CmsBlock;
use Magento\Widget\Block\BlockInterface;

/**
* Cms Static Block Widget
*
* @author Magento Core Team <core@magentocommerce.com>
* @author Magento Core Team <core@magentocommerce.com>
*/
class Block extends \Magento\Framework\View\Element\Template implements \Magento\Widget\Block\BlockInterface
class Block extends \Magento\Framework\View\Element\Template implements BlockInterface, IdentityInterface
{
/**
* @var \Magento\Cms\Model\Template\FilterProvider
Expand All @@ -31,6 +39,11 @@ class Block extends \Magento\Framework\View\Element\Template implements \Magento
*/
protected $_blockFactory;

/**
* @var CmsBlock
*/
private $block;

/**
* @param \Magento\Framework\View\Element\Template\Context $context
* @param \Magento\Cms\Model\Template\FilterProvider $filterProvider
Expand All @@ -49,8 +62,9 @@ public function __construct(
}

/**
* Prepare block text and determine whether block output enabled or not
* Prevent blocks recursion if needed
* Prepare block text and determine whether block output enabled or not.
*
* Prevent blocks recursion if needed.
*
* @return $this
*/
Expand All @@ -65,19 +79,63 @@ protected function _beforeToHtml()
}
self::$_widgetUsageMap[$blockHash] = true;

if ($blockId) {
$storeId = $this->_storeManager->getStore()->getId();
/** @var \Magento\Cms\Model\Block $block */
$block = $this->_blockFactory->create();
$block->setStoreId($storeId)->load($blockId);
if ($block->isActive()) {
$block = $this->getBlock();

if ($block && $block->isActive()) {
try {
$storeId = $this->_storeManager->getStore()->getId();
$this->setText(
$this->_filterProvider->getBlockFilter()->setStoreId($storeId)->filter($block->getContent())
);
} catch (NoSuchEntityException $e) {
}
}

unset(self::$_widgetUsageMap[$blockHash]);
return $this;
}

/**
* Get identities of the Cms Block
*
* @return array
*/
public function getIdentities()
{
$block = $this->getBlock();

if ($block) {
return $block->getIdentities();
}

return [];
}

/**
* Get block
*
* @return CmsBlock|null
*/
private function getBlock(): ?CmsBlock
{
if ($this->block) {
return $this->block;
}

$blockId = $this->getData('block_id');

if ($blockId) {
try {
$storeId = $this->_storeManager->getStore()->getId();
/** @var \Magento\Cms\Model\Block $block */
$block = $this->_blockFactory->create();
$block->setStoreId($storeId)->load($blockId);
$this->block = $block;

return $block;
} catch (NoSuchEntityException $e) {
}
}

return null;
}
}
8 changes: 0 additions & 8 deletions app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -501,14 +501,6 @@ public function uploadFile($targetPath, $type = null)
// create thumbnail
$this->resizeFile($targetPath . '/' . $uploader->getUploadedFileName(), true);

$result['cookie'] = [
'name' => $this->getSession()->getName(),
'value' => $this->getSession()->getSessionId(),
'lifetime' => $this->getSession()->getCookieLifetime(),
'path' => $this->getSession()->getCookiePath(),
'domain' => $this->getSession()->getCookieDomain(),
];

return $result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
<description value="Admin should be able to create a CMS page with widget type: Recently Compared Products"/>
<severity value="CRITICAL"/>
<testCaseId value="MAGETWO-83792"/>
<!--Skip test due to MC-1284-->
<group value="skip"/>
</annotations>
<!--Main test-->
<before>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,14 +440,7 @@ public function testUploadFile()
$thumbnailDestination = $thumbnailTargetPath . '/' . $fileName;
$type = 'image';
$result = [
'result',
'cookie' => [
'name' => 'session_name',
'value' => '1',
'lifetime' => '50',
'path' => 'cookie/path',
'domain' => 'cookie_domain',
],
'result'
];
$uploader = $this->getMockBuilder(\Magento\MediaStorage\Model\File\Uploader::class)
->disableOriginalConstructor()
Expand Down Expand Up @@ -507,17 +500,6 @@ public function testUploadFile()

$this->adapterFactoryMock->expects($this->atLeastOnce())->method('create')->willReturn($image);

$this->sessionMock->expects($this->atLeastOnce())->method('getName')
->willReturn($result['cookie']['name']);
$this->sessionMock->expects($this->atLeastOnce())->method('getSessionId')
->willReturn($result['cookie']['value']);
$this->sessionMock->expects($this->atLeastOnce())->method('getCookieLifetime')
->willReturn($result['cookie']['lifetime']);
$this->sessionMock->expects($this->atLeastOnce())->method('getCookiePath')
->willReturn($result['cookie']['path']);
$this->sessionMock->expects($this->atLeastOnce())->method('getCookieDomain')
->willReturn($result['cookie']['domain']);

$this->assertEquals($result, $this->imagesStorage->uploadFile($targetPath, $type));
}
}
Loading

0 comments on commit 25285a3

Please sign in to comment.