Skip to content

Commit

Permalink
Merge remote-tracking branch 'mainline/2.3-develop' into 2.3-develop-…
Browse files Browse the repository at this point in the history
…PR-yogesh-5
  • Loading branch information
nmalevanec committed Feb 18, 2019
2 parents d7691a6 + 5569b86 commit 3330bd9
Show file tree
Hide file tree
Showing 484 changed files with 12,280 additions and 5,654 deletions.
18 changes: 16 additions & 2 deletions app/code/Magento/AsynchronousOperations/Model/MassConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace Magento\AsynchronousOperations\Model;

use Magento\Framework\App\ResourceConnection;
use Magento\Framework\Registry;
use Psr\Log\LoggerInterface;
use Magento\Framework\MessageQueue\MessageLockException;
use Magento\Framework\MessageQueue\ConnectionLostException;
Expand Down Expand Up @@ -58,6 +59,11 @@ class MassConsumer implements ConsumerInterface
*/
private $operationProcessor;

/**
* @var Registry
*/
private $registry;

/**
* Initialize dependencies.
*
Expand All @@ -67,14 +73,16 @@ class MassConsumer implements ConsumerInterface
* @param ConsumerConfigurationInterface $configuration
* @param OperationProcessorFactory $operationProcessorFactory
* @param LoggerInterface $logger
* @param Registry $registry
*/
public function __construct(
CallbackInvoker $invoker,
ResourceConnection $resource,
MessageController $messageController,
ConsumerConfigurationInterface $configuration,
OperationProcessorFactory $operationProcessorFactory,
LoggerInterface $logger
LoggerInterface $logger,
Registry $registry = null
) {
$this->invoker = $invoker;
$this->resource = $resource;
Expand All @@ -84,20 +92,26 @@ public function __construct(
'configuration' => $configuration
]);
$this->logger = $logger;
$this->registry = $registry ?? \Magento\Framework\App\ObjectManager::getInstance()
->get(Registry::class);
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function process($maxNumberOfMessages = null)
{
$this->registry->register('isSecureArea', true, true);

$queue = $this->configuration->getQueue();

if (!isset($maxNumberOfMessages)) {
$queue->subscribe($this->getTransactionCallback($queue));
} else {
$this->invoker->invoke($queue, $maxNumberOfMessages, $this->getTransactionCallback($queue));
}

$this->registry->unregister('isSecureArea');
}

/**
Expand Down
11 changes: 10 additions & 1 deletion app/code/Magento/Backend/Block/Template/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* the classes they were introduced for.
*
* @api
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @since 100.0.2
*/
Expand Down Expand Up @@ -173,6 +174,8 @@ public function getAuthorization()
}

/**
* Get Backend Session
*
* @return \Magento\Backend\Model\Session
*/
public function getBackendSession()
Expand All @@ -181,6 +184,8 @@ public function getBackendSession()
}

/**
* Get Math Random
*
* @return \Magento\Framework\Math\Random
*/
public function getMathRandom()
Expand All @@ -189,6 +194,8 @@ public function getMathRandom()
}

/**
* Get Form Key
*
* @return \Magento\Framework\Data\Form\FormKey
*/
public function getFormKey()
Expand All @@ -197,7 +204,9 @@ public function getFormKey()
}

/**
* @return \Magento\Framework\Data\Form\FormKey
* Get Class Name Builder
*
* @return \Magento\Framework\Code\NameBuilder
*/
public function getNameBuilder()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
*/
namespace Magento\Backend\Controller\Adminhtml\System\Design;

class Save extends \Magento\Backend\Controller\Adminhtml\System\Design
use Magento\Framework\App\Action\HttpPostActionInterface;

/**
* Save design action.
*/
class Save extends \Magento\Backend\Controller\Adminhtml\System\Design implements HttpPostActionInterface
{
/**
* Filtering posted data. Converting localized data if needed
Expand All @@ -26,6 +31,8 @@ protected function _filterPostData($data)
}

/**
* Save design action.
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function execute()
Expand Down Expand Up @@ -54,10 +61,10 @@ public function execute()
} catch (\Exception $e) {
$this->messageManager->addErrorMessage($e->getMessage());
$this->_objectManager->get(\Magento\Backend\Model\Session::class)->setDesignData($data);
return $resultRedirect->setPath('adminhtml/*/', ['id' => $design->getId()]);
return $resultRedirect->setPath('*/*/edit', ['id' => $design->getId()]);
}
}

return $resultRedirect->setPath('adminhtml/*/');
return $resultRedirect->setPath('*/*/');
}
}
15 changes: 13 additions & 2 deletions app/code/Magento/Backup/Model/Backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* @method string getPath()
* @method string getName()
* @method string getTime()
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @api
* @since 100.0.2
Expand Down Expand Up @@ -80,6 +81,7 @@ class Backup extends \Magento\Framework\DataObject implements \Magento\Framework
* @param \Magento\Framework\Encryption\EncryptorInterface $encryptor
* @param \Magento\Framework\Filesystem $filesystem
* @param array $data
* @throws \Magento\Framework\Exception\FileSystemException
*/
public function __construct(
\Magento\Backup\Helper\Data $helper,
Expand Down Expand Up @@ -242,7 +244,7 @@ public function setFile(&$content)
/**
* Return content of backup file
*
* @return string
* @return array
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function &getFile()
Expand Down Expand Up @@ -275,8 +277,9 @@ public function deleteFile()
*
* @param bool $write
* @return $this
* @throws \Magento\Framework\Exception\InputException
* @throws \Magento\Framework\Backup\Exception\NotEnoughPermissions
* @throws \Magento\Framework\Exception\FileSystemException
* @throws \Magento\Framework\Exception\InputException
*/
public function open($write = false)
{
Expand Down Expand Up @@ -330,6 +333,7 @@ protected function _getStream()
*
* @param int $length
* @return string
* @throws \Magento\Framework\Exception\InputException
*/
public function read($length)
{
Expand All @@ -340,6 +344,7 @@ public function read($length)
* Check end of file.
*
* @return bool
* @throws \Magento\Framework\Exception\InputException
*/
public function eof()
{
Expand Down Expand Up @@ -370,6 +375,7 @@ public function write($string)
* Close open backup file
*
* @return $this
* @throws \Magento\Framework\Exception\InputException
*/
public function close()
{
Expand All @@ -383,6 +389,8 @@ public function close()
* Print output
*
* @return string
* @return \Magento\Framework\Filesystem\Directory\ReadInterface|string|void
* @throws \Magento\Framework\Exception\FileSystemException
*/
public function output()
{
Expand All @@ -398,6 +406,8 @@ public function output()
}

/**
* Get Size
*
* @return int|mixed
*/
public function getSize()
Expand All @@ -419,6 +429,7 @@ public function getSize()
*
* @param string $password
* @return bool
* @throws \Exception
*/
public function validateUserPassword($password)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ public function getChildren($item)
}

/**
* Check if item can be shipped separately
*
* @param mixed $item
* @return bool
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
Expand Down Expand Up @@ -136,6 +138,8 @@ public function isShipmentSeparately($item = null)
}

/**
* Check if child items calculated
*
* @param mixed $item
* @return bool
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
Expand Down Expand Up @@ -174,6 +178,8 @@ public function isChildCalculated($item = null)
}

/**
* Retrieve selection attributes values
*
* @param mixed $item
* @return mixed|null
*/
Expand All @@ -191,6 +197,8 @@ public function getSelectionAttributes($item)
}

/**
* Retrieve order item options array
*
* @return array
*/
public function getOrderOptions()
Expand All @@ -212,6 +220,8 @@ public function getOrderOptions()
}

/**
* Retrieve order item
*
* @return mixed
*/
public function getOrderItem()
Expand All @@ -223,6 +233,8 @@ public function getOrderItem()
}

/**
* Get html info for item
*
* @param mixed $item
* @return string
*/
Expand All @@ -245,6 +257,8 @@ public function getValueHtml($item)
}

/**
* Check if we can show price info for this item
*
* @param object $item
* @return bool
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ $isElementReadonly = $block->getElement()
->getReadonly();
?>

<?php if (!($attributeCode === 'price' && $block->getCanReadPrice() === false)) { ?>
<?php if (!($attributeCode === 'price' && $block->getCanReadPrice() === false)): ?>
<div class="<?= /* @escapeNotVerified */ $attributeCode ?> "><?= /* @escapeNotVerified */ $elementHtml ?></div>
<?php } ?>
<?php endif; ?>

<?= $block->getExtendedElement($switchAttributeCode)->toHtml() ?>

Expand All @@ -43,13 +43,13 @@ $isElementReadonly = $block->getElement()
} else {
if ($attribute) {
<?php if ($attributeCode === 'price' && !$block->getCanEditPrice() && $block->getCanReadPrice()
&& $block->getProduct()->isObjectNew()) { ?>
&& $block->getProduct()->isObjectNew()): ?>
<?php $defaultProductPrice = $block->getDefaultProductPrice() ?: "''"; ?>
$attribute.value = <?= /* @escapeNotVerified */ $defaultProductPrice ?>;
<?php } else { ?>
<?php else: ?>
$attribute.disabled = false;
$attribute.addClassName('required-entry');
<?php } ?>
<?php endif; ?>
}
if ($('dynamic-price-warning')) {
$('dynamic-price-warning').hide();
Expand All @@ -58,9 +58,9 @@ $isElementReadonly = $block->getElement()
}

<?php if (!($attributeCode === 'price' && !$block->getCanEditPrice()
&& !$block->getProduct()->isObjectNew())) { ?>
&& !$block->getProduct()->isObjectNew())): ?>
$('<?= /* @escapeNotVerified */ $switchAttributeCode ?>').observe('change', <?= /* @escapeNotVerified */ $switchAttributeCode ?>_change);
<?php } ?>
<?php endif; ?>
Event.observe(window, 'load', function(){
<?= /* @escapeNotVerified */ $switchAttributeCode ?>_change();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,17 @@
<?php endif; ?>

<?php foreach ($items as $_item): ?>
<?php
$shipTogether = ($_item->getOrderItem()->getProductType() == \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) ?
!$_item->getOrderItem()->isShipSeparately() : !$_item->getOrderItem()->getParentItem()->isShipSeparately()
?>
<?php $block->setPriceDataObject($_item) ?>
<?php if ($_item->getOrderItem()->getParentItem()): ?>
<?php
if ($shipTogether) {
continue;
}
?>
<?php $attributes = $block->getSelectionAttributes($_item) ?>
<?php if ($_prevOptionId != $attributes['option_id']): ?>
<tr>
Expand Down Expand Up @@ -60,14 +69,14 @@
</td>
<?php endif; ?>
<td class="col-price">
<?php if ($block->canShowPriceInfo($_item)): ?>
<?php if ($block->canShowPriceInfo($_item) || $shipTogether): ?>
<?= $block->getColumnHtml($_item, 'price') ?>
<?php else: ?>
&nbsp;
<?php endif; ?>
</td>
<td class="col-qty">
<?php if ($block->canShowPriceInfo($_item)): ?>
<?php if ($block->canShowPriceInfo($_item) || $shipTogether): ?>
<table class="qty-table">
<tr>
<th><?= /* @escapeNotVerified */ __('Ordered') ?></th>
Expand Down Expand Up @@ -116,7 +125,7 @@
<?php endif; ?>
</td>
<td class="col-qty-invoice">
<?php if ($block->canShowPriceInfo($_item)): ?>
<?php if ($block->canShowPriceInfo($_item) || $shipTogether): ?>
<?php if ($block->canEditQty()) : ?>
<input type="text"
class="input-text admin__control-text qty-input"
Expand Down
Loading

0 comments on commit 3330bd9

Please sign in to comment.