Skip to content

Commit

Permalink
Merge branch '2.3-develop' of github.com:magento/graphql-ce into 2.3-…
Browse files Browse the repository at this point in the history
…develop#354
  • Loading branch information
XxXgeoXxX committed Feb 28, 2019
2 parents e18e4ac + 908ed15 commit 2e676bf
Show file tree
Hide file tree
Showing 348 changed files with 10,053 additions and 7,582 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/AuthorizenetAcceptjs/etc/payment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Payment:etc/payment.xsd">
<methods>
<method name="authorizenet_acceptjs">
<allow_multiple_address>1</allow_multiple_address>
<allow_multiple_address>0</allow_multiple_address>
</method>
</methods>
</payment>
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@
*/

var config = {
shim: {
acceptjs: {
exports: 'Accept'
},
acceptjssandbox: {
exports: 'Accept'
map: {
'*': {
acceptjssandbox: 'https://jstest.authorize.net/v1/Accept.js',
acceptjs: 'https://js.authorize.net/v1/Accept.js'
}
},
paths: {
acceptjssandbox: 'https://jstest.authorize.net/v1/Accept',
acceptjs: 'https://js.authorize.net/v1/Accept'
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ define([
dependency = 'acceptjssandbox';
}

require([dependency], function (accept) {
require([dependency], function () {
var $body = $('body');

/*
Expand All @@ -26,7 +26,16 @@ define([
* Dynamically-loading-Accept-js-E-WC-03-Accept-js-is-not-loaded/td-p/63283
*/
$body.on('handshake.acceptjs', function () {
deferred.resolve(accept);
/*
* Accept.js doesn't return the library when loading
* and requirejs "shim" can't be used because it only works with the "paths" config option
* and we can't use "paths" because require will try to load ".min.js" in production
* and that doesn't work because it doesn't exist
* and we can't add a query string to force a URL because accept.js will reject it
* and we can't include it locally because they check in the script before loading more scripts
* So, we use the global version as "shim" would
*/
deferred.resolve(window.Accept);
$body.off('handshake.acceptjs');
});
},
Expand Down
12 changes: 11 additions & 1 deletion app/code/Magento/Backend/Block/Template/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
* the classes they were introduced for.
*
* @api
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
* @since 100.0.2
*/
class Context extends \Magento\Framework\View\Element\Template\Context
Expand Down Expand Up @@ -173,6 +175,8 @@ public function getAuthorization()
}

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

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

/**
* Get form key instance.
*
* @return \Magento\Framework\Data\Form\FormKey
*/
public function getFormKey()
Expand All @@ -197,7 +205,9 @@ public function getFormKey()
}

/**
* @return \Magento\Framework\Data\Form\FormKey
* Get name builder instance.
*
* @return \Magento\Framework\Code\NameBuilder
*/
public function getNameBuilder()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ abstract class AbstractRenderer extends \Magento\Backend\Block\AbstractBlock imp
protected $_column;

/**
* Set column for renderer.
*
* @param Column $column
* @return $this
*/
Expand All @@ -38,6 +40,8 @@ public function setColumn($column)
}

/**
* Returns row associated with the renderer.
*
* @return Column
*/
public function getColumn()
Expand All @@ -48,7 +52,7 @@ public function getColumn()
/**
* Renders grid column
*
* @param Object $row
* @param DataObject $row
* @return string
*/
public function render(DataObject $row)
Expand All @@ -66,7 +70,7 @@ public function render(DataObject $row)
/**
* Render column for export
*
* @param Object $row
* @param DataObject $row
* @return string
*/
public function renderExport(DataObject $row)
Expand All @@ -75,7 +79,9 @@ public function renderExport(DataObject $row)
}

/**
* @param Object $row
* Returns value of the row.
*
* @param DataObject $row
* @return mixed
*/
protected function _getValue(DataObject $row)
Expand All @@ -92,7 +98,9 @@ protected function _getValue(DataObject $row)
}

/**
* @param Object $row
* Get pre-rendered input element.
*
* @param DataObject $row
* @return string
*/
public function _getInputValueElement(DataObject $row)
Expand All @@ -108,7 +116,9 @@ public function _getInputValueElement(DataObject $row)
}

/**
* @param Object $row
* Get input value by row.
*
* @param DataObject $row
* @return mixed
*/
protected function _getInputValue(DataObject $row)
Expand All @@ -117,6 +127,8 @@ protected function _getInputValue(DataObject $row)
}

/**
* Renders header of the column,
*
* @return string
*/
public function renderHeader()
Expand Down Expand Up @@ -148,6 +160,8 @@ public function renderHeader()
}

/**
* Render HTML properties.
*
* @return string
*/
public function renderProperty()
Expand All @@ -172,6 +186,8 @@ public function renderProperty()
}

/**
* Returns HTML for CSS.
*
* @return string
*/
public function renderCss()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@
*/
namespace Magento\Backend\Controller\Adminhtml\Dashboard;

class ProductsViewed extends AjaxBlock
use Magento\Framework\App\Action\HttpGetActionInterface;

/**
* Get most viewed products controller.
*/
class ProductsViewed extends AjaxBlock implements HttpGetActionInterface
{
/**
* Gets most viewed products list
*
* @return \Magento\Backend\Model\View\Result\Page
* @return \Magento\Framework\Controller\Result\Raw
*/
public function execute()
{
Expand Down
3 changes: 1 addition & 2 deletions app/code/Magento/Backup/Controller/Adminhtml/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
namespace Magento\Backup\Controller\Adminhtml;

use Magento\Backend\App\Action;
use Magento\Framework\App\Action\HttpGetActionInterface;
use Magento\Backup\Helper\Data as Helper;
use Magento\Framework\App\ObjectManager;

Expand All @@ -18,7 +17,7 @@
* @since 100.0.2
* @SuppressWarnings(PHPMD.AllPurposeAction)
*/
abstract class Index extends Action implements HttpGetActionInterface
abstract class Index extends Action
{
/**
* Authorization level of a basic admin session
Expand Down
7 changes: 5 additions & 2 deletions app/code/Magento/Backup/Controller/Adminhtml/Index/Create.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<?php
/**
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Backup\Controller\Adminhtml\Index;

use Magento\Framework\App\Action\HttpPostActionInterface;
use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\Filesystem;

class Create extends \Magento\Backup\Controller\Adminhtml\Index
/**
* Create backup controller
*/
class Create extends \Magento\Backup\Controller\Adminhtml\Index implements HttpPostActionInterface
{
/**
* Create backup action.
Expand Down
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 @@ -40,7 +40,7 @@ public function __get($name)
}

/**
* Checks for the existance of a property stored in the private $_attributes property
* Checks for the existence of a property stored in the private $_attributes property
*
* @ignore
* @param string $name
Expand Down
23 changes: 22 additions & 1 deletion app/code/Magento/CacheInvalidate/Model/PurgeCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ private function splitTags($tagsPattern)
private function sendPurgeRequestToServers($socketAdapter, $servers, $formattedTagsChunk)
{
$headers = [self::HEADER_X_MAGENTO_TAGS_PATTERN => $formattedTagsChunk];
$unresponsiveServerError = [];
foreach ($servers as $server) {
$headers['Host'] = $server->getHost();
try {
Expand All @@ -131,10 +132,30 @@ private function sendPurgeRequestToServers($socketAdapter, $servers, $formattedT
$socketAdapter->read();
$socketAdapter->close();
} catch (\Exception $e) {
$this->logger->critical($e->getMessage(), compact('server', 'formattedTagsChunk'));
$unresponsiveServerError[] = "Cache host: " . $server->getHost() . ":" . $server->getPort() .
"resulted in error message: " . $e->getMessage();
}
}

$errorCount = count($unresponsiveServerError);

if ($errorCount > 0) {
$loggerMessage = implode(" ", $unresponsiveServerError);

if ($errorCount == count($servers)) {
$this->logger->critical(
'No cache server(s) could be purged ' . $loggerMessage,
compact('server', 'formattedTagsChunk')
);
return false;
}

$this->logger->warning(
'Unresponsive cache server(s) hit' . $loggerMessage,
compact('server', 'formattedTagsChunk')
);
}

$this->logger->execute(compact('servers', 'formattedTagsChunk'));
return true;
}
Expand Down
Loading

0 comments on commit 2e676bf

Please sign in to comment.