Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/2.3-develop' into 540-new-fixtur…
Browse files Browse the repository at this point in the history
…e-for-SetUpsShippingMethodsOnCartTest
  • Loading branch information
naydav committed Apr 16, 2019
2 parents f2d3539 + af6820c commit 74fb0bd
Show file tree
Hide file tree
Showing 50 changed files with 1,231 additions and 120 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -4136,7 +4136,7 @@ Tests:
* Moved Multishipping functionality to newly created module Multishipping
* Extracted Product duplication behavior from Product model to Product\Copier model
* Replaced event "catalog_model_product_duplicate" with composite Product\Copier model
* Replaced event "catalog_product_prepare_save" with controller product initialization helper that can be customozed via plugins
* Replaced event "catalog_product_prepare_save" with controller product initialization helper that can be customized via plugins
* Consolidated Authorize.Net functionality in single module Authorizenet
* Eliminated dependency of Sales module on Shipping and Usa modules
* Eliminated dependency of Shipping module on Customer module
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -45,7 +45,7 @@ Please review the [Code Contributions guide](https://devdocs.magento.com/guides/

## Reporting Security Issues

To report security vulnerabilities in Magento software or web sites, please create a Bugcrowd researcher account [there](https://bugcrowd.com/magento) to submit and follow-up your issue. Learn more about reporting security issues [here](https://magento.com/security/reporting-magento-security-issue).
To report security vulnerabilities or learn more about reporting security issues in Magento software or web sites visit the [Magento Bug Bounty Program](https://hackerone.com/magento) on hackerone. Please create a hackerone account [there](https://hackerone.com/magento) to submit and follow-up your issue.

Stay up-to-date on the latest security news and patches for Magento by signing up for [Security Alert Notifications](https://magento.com/security/sign-up).

Expand Down
4 changes: 3 additions & 1 deletion app/bootstrap.php
Expand Up @@ -8,7 +8,9 @@
* Environment initialization
*/
error_reporting(E_ALL);
stream_wrapper_unregister('phar');
if (in_array('phar', \stream_get_wrappers())) {
stream_wrapper_unregister('phar');
}
#ini_set('display_errors', 1);

/* PHP version validation */
Expand Down
Expand Up @@ -75,7 +75,7 @@ public function execute()
$this->logger->critical($e);
$this->messageManager->addExceptionMessage(
$e,
'The order #' . $quote->getReservedOrderId() . ' cannot be processed.'
__('The order #%1 cannot be processed.', $quote->getReservedOrderId())
);
}

Expand Down
Expand Up @@ -4,13 +4,13 @@
* See COPYING.txt for license details.
*/

namespace Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Attributes;

/**
* Bundle Extended Attribures Block
* Bundle Extended Attribures Block.
*
* @author Magento Core Team <core@magentocommerce.com>
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Attributes;

class Extend extends \Magento\Catalog\Block\Adminhtml\Form\Renderer\Fieldset\Element
{
/**
Expand Down Expand Up @@ -75,7 +75,7 @@ public function getElementHtml()
}

/**
* Execute method getElementHtml from parrent class
* Execute method getElementHtml from parent class
*
* @return string
*/
Expand All @@ -85,6 +85,8 @@ public function getParentElementHtml()
}

/**
* Get options.
*
* @return array
*/
public function getOptions()
Expand All @@ -106,6 +108,8 @@ public function getOptions()
}

/**
* Is disabled field.
*
* @return bool
*/
public function isDisabledField()
Expand All @@ -118,6 +122,8 @@ public function isDisabledField()
}

/**
* Get product.
*
* @return mixed
*/
public function getProduct()
Expand All @@ -129,6 +135,8 @@ public function getProduct()
}

/**
* Get extended element.
*
* @param string $switchAttributeCode
* @return \Magento\Framework\Data\Form\Element\Select
* @throws \Magento\Framework\Exception\LocalizedException
Expand Down
Expand Up @@ -69,6 +69,7 @@ public function __construct(

/**
* Overloaded method for getting list of bundle options
*
* Caches result in quote item, because it can be used in cart 'recent view' and on same page in cart checkout
*
* @return array
Expand All @@ -88,7 +89,7 @@ public function getMessages()
$messages = [];
$quoteItem = $this->getItem();

// Add basic messages occuring during this page load
// Add basic messages occurring during this page load
$baseMessages = $quoteItem->getMessage(false);
if ($baseMessages) {
foreach ($baseMessages as $message) {
Expand Down
Expand Up @@ -6,16 +6,16 @@

namespace Magento\ConfigurableProduct\Setup\Patch\Data;

use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\App\ResourceConnection;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\Patch\DataPatchInterface;
use Magento\Framework\Setup\Patch\PatchVersionInterface;
use Magento\ConfigurableProduct\Model\Product\Type\Configurable;

/**
* Class InstallInitialConfigurableAttributes
*
* @package Magento\ConfigurableProduct\Setup\Patch
*/
class InstallInitialConfigurableAttributes implements DataPatchInterface, PatchVersionInterface
Expand All @@ -24,6 +24,7 @@ class InstallInitialConfigurableAttributes implements DataPatchInterface, PatchV
* @var ModuleDataSetupInterface
*/
private $moduleDataSetup;

/**
* @var EavSetupFactory
*/
Expand All @@ -43,7 +44,7 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function apply()
{
Expand All @@ -64,40 +65,43 @@ public function apply()
'color'
];
foreach ($attributes as $attributeCode) {
$relatedProductTypes = explode(
',',
$eavSetup->getAttribute(\Magento\Catalog\Model\Product::ENTITY, $attributeCode, 'apply_to')
);
if (!in_array(Configurable::TYPE_CODE, $relatedProductTypes)) {
$relatedProductTypes[] = Configurable::TYPE_CODE;
$eavSetup->updateAttribute(
\Magento\Catalog\Model\Product::ENTITY,
$attributeCode,
'apply_to',
implode(',', $relatedProductTypes)
$attribute = $eavSetup->getAttribute(\Magento\Catalog\Model\Product::ENTITY, $attributeCode, 'apply_to');
if ($attribute) {
$relatedProductTypes = explode(
',',
$attribute
);
if (!in_array(Configurable::TYPE_CODE, $relatedProductTypes)) {
$relatedProductTypes[] = Configurable::TYPE_CODE;
$eavSetup->updateAttribute(
\Magento\Catalog\Model\Product::ENTITY,
$attributeCode,
'apply_to',
implode(',', $relatedProductTypes)
);
}
}
}
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public static function getDependencies()
{
return [];
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public static function getVersion()
{
return '2.0.0';
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getAliases()
{
Expand Down
Expand Up @@ -9,8 +9,8 @@
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="CustomerLogoutStorefrontByMenuItemsActionGroup">
<conditionalClick selector="{{StorefrontPanelHeaderSection.customerWelcome}}"
dependentSelector="{{StorefrontPanelHeaderSection.customerWelcomeMenu}}"
<conditionalClick selector="{{StorefrontPanelHeaderSection.customerWelcomeMenu}}"
dependentSelector="{{StorefrontPanelHeaderSection.customerLogoutLink}}"
visible="false"
stepKey="clickHeaderCustomerMenuButton" />
<click selector="{{StorefrontPanelHeaderSection.customerLogoutLink}}" stepKey="clickSignOutButton" />
Expand Down
Expand Up @@ -15,8 +15,8 @@
<element name="welcomeMessage" type="text" selector="header>.panel .greet.welcome" />
<element name="createAnAccountLink" type="select" selector="//div[@class='panel wrapper']//li/a[contains(.,'Create an Account')]" timeout="30"/>
<element name="notYouLink" type="button" selector=".greet.welcome span a"/>
<element name="customerWelcome" type="text" selector=".panel.header .customer-welcome"/>
<element name="customerWelcomeMenu" type="text" selector=".panel.header .customer-welcome .customer-menu"/>
<element name="customerWelcome" type="text" selector=".panel.header .greet.welcome"/>
<element name="customerWelcomeMenu" type="text" selector=".panel.header .customer-welcome .customer-name"/>
<element name="customerLoginLink" type="button" selector=".panel.header .header.links .authorization-link a" timeout="30"/>
<element name="customerLogoutLink" type="text" selector=".panel.header .customer-welcome .customer-menu .authorization-link a" timeout="30"/>
</section>
Expand Down
Expand Up @@ -16,7 +16,6 @@
data-toggle="dropdown"
data-trigger-keypress-button="true"
data-bind="scope: 'customer'">
<span data-bind="text: customer().fullname"></span>
<button type="button"
class="action switch"
tabindex="-1"
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Dhl/etc/adminhtml/system.xml
Expand Up @@ -31,7 +31,7 @@
<field id="account" translate="label" type="text" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
<label>Account Number</label>
</field>
<field id="content_type" translate="label" type="select" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
<field id="content_type" translate="label comment" type="select" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
<label>Content Type (Non Domestic)</label>
<comment>Whether to use Documents or NonDocuments service for non domestic shipments. (Shipments within the EU are classed as domestic)</comment>
<source_model>Magento\Dhl\Model\Source\Contenttype</source_model>
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Dhl/i18n/en_US.csv
Expand Up @@ -61,6 +61,7 @@ Title,Title
Password,Password
"Account Number","Account Number"
"Content Type","Content Type"
"Whether to use Documents or NonDocuments service for non domestic shipments. (Shipments within the EU are classed as domestic)","Whether to use Documents or NonDocuments service for non domestic shipments. (Shipments within the EU are classed as domestic)"
"Calculate Handling Fee","Calculate Handling Fee"
"Handling Applied","Handling Applied"
"""Per Order"" allows a single handling fee for the entire order. ""Per Package"" allows an individual handling fee for each package.","""Per Order"" allows a single handling fee for the entire order. ""Per Package"" allows an individual handling fee for each package."
Expand Down
Expand Up @@ -9,6 +9,8 @@
use Magento\Store\Model\ScopeInterface;

/**
* Saves data from order to purchased links.
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class SaveDownloadableOrderItemObserver implements ObserverInterface
Expand Down Expand Up @@ -92,9 +94,15 @@ public function execute(\Magento\Framework\Event\Observer $observer)
if ($purchasedLink->getId()) {
return $this;
}
$storeId = $orderItem->getOrder()->getStoreId();
$orderStatusToEnableItem = $this->_scopeConfig->getValue(
\Magento\Downloadable\Model\Link\Purchased\Item::XML_PATH_ORDER_ITEM_STATUS,
ScopeInterface::SCOPE_STORE,
$storeId
);
if (!$product) {
$product = $this->_createProductModel()->setStoreId(
$orderItem->getOrder()->getStoreId()
$storeId
)->load(
$orderItem->getProductId()
);
Expand Down Expand Up @@ -150,6 +158,8 @@ public function execute(\Magento\Framework\Event\Observer $observer)
)->setNumberOfDownloadsBought(
$numberOfDownloads
)->setStatus(
\Magento\Sales\Model\Order\Item::STATUS_PENDING == $orderStatusToEnableItem ?
\Magento\Downloadable\Model\Link\Purchased\Item::LINK_STATUS_AVAILABLE :
\Magento\Downloadable\Model\Link\Purchased\Item::LINK_STATUS_PENDING
)->setCreatedAt(
$orderItem->getCreatedAt()
Expand All @@ -165,6 +175,8 @@ public function execute(\Magento\Framework\Event\Observer $observer)
}

/**
* Create purchased model.
*
* @return \Magento\Downloadable\Model\Link\Purchased
*/
protected function _createPurchasedModel()
Expand All @@ -173,6 +185,8 @@ protected function _createPurchasedModel()
}

/**
* Create product model.
*
* @return \Magento\Catalog\Model\Product
*/
protected function _createProductModel()
Expand All @@ -181,6 +195,8 @@ protected function _createProductModel()
}

/**
* Create purchased item model.
*
* @return \Magento\Downloadable\Model\Link\Purchased\Item
*/
protected function _createPurchasedItemModel()
Expand All @@ -189,6 +205,8 @@ protected function _createPurchasedItemModel()
}

/**
* Create items collection.
*
* @return \Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\Collection
*/
protected function _createItemsCollection()
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Quote/Model/Quote/Item/Compare.php
Expand Up @@ -50,7 +50,7 @@ protected function getOptionValues($value)
if (is_string($value) && $this->jsonValidator->isValid($value)) {
$value = $this->serializer->unserialize($value);
if (is_array($value)) {
unset($value['qty'], $value['uenc']);
unset($value['qty'], $value['uenc'], $value['related_product'], $value['item']);
$value = array_filter($value, function ($optionValue) {
return !empty($optionValue);
});
Expand Down
Expand Up @@ -7,6 +7,11 @@

use Magento\Framework\Event\ObserverInterface;

/**
* Handle customer VAT number on collect_totals_before event of quote address.
*
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
*/
class CollectTotalsObserver implements ObserverInterface
{
/**
Expand Down Expand Up @@ -124,7 +129,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
);
}

if ($groupId) {
if ($groupId !== null) {
$address->setPrevQuoteCustomerGroupId($quote->getCustomerGroupId());
$quote->setCustomerGroupId($groupId);
$this->customerSession->setCustomerGroupId($groupId);
Expand Down
Expand Up @@ -199,7 +199,7 @@ public function testDispatchWithCustomerCountryNotInEUAndNotLoggedCustomerInGrou
->method('getNotLoggedInGroup')
->will($this->returnValue($this->groupInterfaceMock));
$this->groupInterfaceMock->expects($this->once())
->method('getId')->will($this->returnValue(0));
->method('getId')->will($this->returnValue(null));
$this->vatValidatorMock->expects($this->once())
->method('isEnabled')
->with($this->quoteAddressMock, $this->storeId)
Expand All @@ -220,9 +220,6 @@ public function testDispatchWithCustomerCountryNotInEUAndNotLoggedCustomerInGrou
$this->returnValue(false)
);

$groupMock = $this->getMockBuilder(\Magento\Customer\Api\Data\GroupInterface::class)
->disableOriginalConstructor()
->getMock();
$this->customerMock->expects($this->once())->method('getId')->will($this->returnValue(null));

/** Assertions */
Expand Down

0 comments on commit 74fb0bd

Please sign in to comment.