Skip to content

Commit

Permalink
ISSUE-9924 Merge remote-tracking branch 'upstream/develop' into issue…
Browse files Browse the repository at this point in the history
…-9924

* upstream/develop: (60 commits)
  Fix typo in comment
  Move prefix and suffix default values to a new PR
  MAGETWO-68877: Issue #7988 Typo changed also added comments for each index, getters and setters. #9484
  Revert "MAGETWO-69728: Fixes layered navigation options being cached using the wrong store id. #9873"
  MAGETWO-67500: setup:di:compile returns exit code 0 if errors are found #7780
  Fix prefix, middle name and suffix were not prefilled in the checkout
  add middle name to checkout address html templates #8878
  Using Command output as message which actually provides more information for debugging than just the path
  Handling CLI error as a failure when validating composer.json file
  MAGETWO-69805: Return array of blocks as items instead of array of arrays #9157
  MAGETWO-69666: Return array of pages as items instead of array of arrays #9823
  MAGETWO-69723: Email to a Friend feature #9824
  MAGETWO-69539: PHP "soap" extension is not declared in composer.json but can be used by Magento modules
  MAGETWO-67087: Saving category deletes url-rewrites for products in anchor categories
  MAGETWO-63054: [Catalog] MSRP field is not displayed for bundle products with fixed price
  MAGETWO-67087: Saving category deletes url-rewrites for products in anchor categories
  MAGETWO-67087: Saving category deletes url-rewrites for products in anchor categories
  MAGETWO-67087: Saving category deletes url-rewrites for products in anchor categories
  MAGETWO-67087: Saving category deletes url-rewrites for products in anchor categories
  MAGETWO-67087: Saving category deletes url-rewrites for products in anchor categories
  ...
  • Loading branch information
Anton Evers committed Jun 14, 2017
2 parents 95b1684 + ec99590 commit 322c357
Show file tree
Hide file tree
Showing 77 changed files with 1,311 additions and 227 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
data-validate="{required:true}"
value=""
placeholder="<?php /* @escapeNotVerified */ echo __('password') ?>"
autocomplete="off"
autocomplete="new-password"
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<fieldset class="admin__fieldset password-box-container">
<div class="admin__field field _required">
<label for="password" class="admin__field-label"><span><?php /* @escapeNotVerified */ echo __('User Password')?></span></label>
<div class="admin__field-control"><input type="password" name="password" id="password" class="admin__control-text required-entry" autocomplete="off"></div>
<div class="admin__field-control"><input type="password" name="password" id="password" class="admin__control-text required-entry" autocomplete="new-password"></div>
</div>

<div class="admin__field field maintenance-checkbox-container">
Expand Down Expand Up @@ -119,7 +119,7 @@
<span><?php /* @escapeNotVerified */ echo __('FTP Password') ?></span>
</label>
<div class="admin__field-control">
<input type="password" class="admin__control-text" name="ftp_pass" id="ftp_pass" autocomplete="off">
<input type="password" class="admin__control-text" name="ftp_pass" id="ftp_pass" autocomplete="new-password">
</div>
</div>
<div class="admin__field field">
Expand Down
10 changes: 5 additions & 5 deletions app/code/Magento/Braintree/Block/Paypal/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
*/
namespace Magento\Braintree\Block\Paypal;

use Magento\Checkout\Model\Session;
use Magento\Braintree\Gateway\Config\PayPal\Config;
use Magento\Braintree\Model\Ui\ConfigProvider;
use Magento\Catalog\Block\ShortcutInterface;
use Magento\Framework\View\Element\Template;
use Magento\Checkout\Model\Session;
use Magento\Framework\Locale\ResolverInterface;
use Magento\Braintree\Model\Ui\ConfigProvider;
use Magento\Framework\View\Element\Template;
use Magento\Framework\View\Element\Template\Context;
use Magento\Braintree\Gateway\Config\PayPal\Config;
use Magento\Payment\Model\MethodInterface;

/**
Expand Down Expand Up @@ -110,7 +110,7 @@ public function getContainerId()
*/
public function getLocale()
{
return strtolower($this->localeResolver->getLocale());
return $this->localeResolver->getLocale();
}

/**
Expand Down
93 changes: 93 additions & 0 deletions app/code/Magento/Braintree/Model/LocaleResolver.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Braintree\Model;

use Magento\Framework\Locale\ResolverInterface;
use Magento\Braintree\Gateway\Config\PayPal\Config;

class LocaleResolver implements ResolverInterface
{
/**
* @var ResolverInterface
*/
private $resolver;

/**
* @var Config
*/
private $config;

/**
* @param ResolverInterface $resolver
* @param Config $config
*/
public function __construct(ResolverInterface $resolver, Config $config)
{
$this->resolver = $resolver;
$this->config = $config;
}

/**
* @inheritdoc
*/
public function getDefaultLocalePath()
{
return $this->resolver->getDefaultLocalePath();
}

/**
* @inheritdoc
*/
public function setDefaultLocale($locale)
{
return $this->resolver->setDefaultLocale($locale);
}

/**
* @inheritdoc
*/
public function getDefaultLocale()
{
return $this->resolver->getDefaultLocale();
}

/**
* @inheritdoc
*/
public function setLocale($locale = null)
{
return $this->resolver->setLocale($locale);
}

/**
* Gets store's locale or the `en_US` locale if store's locale does not supported by PayPal.
*
* @return string
*/
public function getLocale()
{
$locale = $this->resolver->getLocale();
$allowedLocales = $this->config->getValue('supported_locales');

return strpos($allowedLocales, $locale) !== false ? $locale : 'en_US';
}

/**
* @inheritdoc
*/
public function emulate($scopeId)
{
return $this->resolver->emulate($scopeId);
}

/**
* @inheritdoc
*/
public function revert()
{
return $this->resolver->revert();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function getConfig()
'title' => $this->config->getTitle(),
'isAllowShippingAddressOverride' => $this->config->isAllowToEditShippingAddress(),
'merchantName' => $this->config->getMerchantName(),
'locale' => strtolower($this->resolver->getLocale()),
'locale' => $this->resolver->getLocale(),
'paymentAcceptanceMarkSrc' =>
'https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-medium.png',
'vaultCode' => self::PAYPAL_VAULT_CODE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,42 +49,35 @@ protected function setUp()
/**
* Run test getConfig method
*
* @param array $config
* @param array $expected
* @dataProvider getConfigDataProvider
*/
public function testGetConfig($expected)
{
$this->config->expects(static::once())
->method('isActive')
$this->config->method('isActive')
->willReturn(true);

$this->config->expects(static::once())
->method('isAllowToEditShippingAddress')
$this->config->method('isAllowToEditShippingAddress')
->willReturn(true);

$this->config->expects(static::once())
->method('getMerchantName')
$this->config->method('getMerchantName')
->willReturn('Test');

$this->config->expects(static::once())
->method('getTitle')
$this->config->method('getTitle')
->willReturn('Payment Title');

$this->localeResolver->expects(static::once())
->method('getLocale')
$this->localeResolver->method('getLocale')
->willReturn('en_US');

$this->config->expects(static::once())
->method('isSkipOrderReview')
$this->config->method('isSkipOrderReview')
->willReturn(false);

$this->config->expects(static::once())
->method('getPayPalIcon')
$this->config->method('getPayPalIcon')
->willReturn([
'width' => 30, 'height' => 26, 'url' => 'https://icon.test.url'
]);

static::assertEquals($expected, $this->configProvider->getConfig());
self::assertEquals($expected, $this->configProvider->getConfig());
}

/**
Expand All @@ -101,7 +94,7 @@ public function getConfigDataProvider()
'title' => 'Payment Title',
'isAllowShippingAddressOverride' => true,
'merchantName' => 'Test',
'locale' => 'en_us',
'locale' => 'en_US',
'paymentAcceptanceMarkSrc' =>
'https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-medium.png',
'vaultCode' => ConfigProvider::PAYPAL_VAULT_CODE,
Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/Braintree/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<order_status>processing</order_status>
<environment>sandbox</environment>
<allowspecific>0</allowspecific>
<sdk_url><![CDATA[https://js.braintreegateway.com/js/braintree-2.25.0.min.js]]></sdk_url>
<sdk_url><![CDATA[https://js.braintreegateway.com/js/braintree-2.32.0.min.js]]></sdk_url>
<public_key backend_model="Magento\Config\Model\Config\Backend\Encrypted" />
<private_key backend_model="Magento\Config\Model\Config\Backend\Encrypted" />
<masked_fields>cvv,number</masked_fields>
Expand Down Expand Up @@ -66,6 +66,7 @@
<can_capture_vault>1</can_capture_vault>
<privateInfoKeys>processorResponseCode,processorResponseText,paymentId</privateInfoKeys>
<paymentInfoKeys>processorResponseCode,processorResponseText,paymentId,payerEmail</paymentInfoKeys>
<supported_locales>en_US,en_GB,en_AU,da_DK,fr_FR,fr_CA,de_DE,zh_HK,it_IT,nl_NL,no_NO,pl_PL,es_ES,sv_SE,tr_TR,pt_BR,ja_JP,id_ID,ko_KR,pt_PT,ru_RU,th_TH,zh_CN,zh_TW</supported_locales>
</braintree_paypal>
<braintree_cc_vault>
<model>BraintreeCreditCardVaultFacade</model>
Expand Down
7 changes: 7 additions & 0 deletions app/code/Magento/Braintree/etc/frontend/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

<type name="Magento\Braintree\Block\Paypal\Button">
<arguments>
<argument name="localeResolver" xsi:type="object">Magento\Braintree\Model\LocaleResolver</argument>
<argument name="data" xsi:type="array">
<item name="template" xsi:type="string">Magento_Braintree::paypal/button.phtml</item>
<item name="alias" xsi:type="string">braintree.paypal.mini-cart</item>
Expand All @@ -54,4 +55,10 @@
<argument name="payment" xsi:type="object">BraintreePayPalFacade</argument>
</arguments>
</type>

<type name="Magento\Braintree\Model\Ui\PayPal\ConfigProvider">
<arguments>
<argument name="resolver" xsi:type="object">Magento\Braintree\Model\LocaleResolver</argument>
</arguments>
</type>
</config>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
var config = {
map: {
'*': {
braintree: 'https://js.braintreegateway.com/js/braintree-2.25.0.min.js'
braintree: 'https://js.braintreegateway.com/js/braintree-2.32.0.min.js'
}
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ define(
event.preventDefault();

registry.get(self.integrationName, function (integration) {
integration.paypal.initAuthFlow();
try {
integration.paypal.initAuthFlow();
} catch (e) {
$this.attr('disabled', 'disabled');
}
});
});
}.bind(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ define([
'Magento_Checkout/js/model/full-screen-loader',
'Magento_Checkout/js/model/payment/additional-validators',
'Magento_Vault/js/view/payment/vault-enabler',
'Magento_Checkout/js/action/create-billing-address'
'Magento_Checkout/js/action/create-billing-address',
'mage/translate'
], function (
$,
_,
Expand All @@ -23,7 +24,8 @@ define([
fullScreenLoader,
additionalValidators,
VaultEnabler,
createBillingAddress
createBillingAddress,
$t
) {
'use strict';

Expand Down Expand Up @@ -403,7 +405,13 @@ define([
*/
payWithPayPal: function () {
if (additionalValidators.validate()) {
Braintree.checkout.paypal.initAuthFlow();
try {
Braintree.checkout.paypal.initAuthFlow();
} catch (e) {
this.messageContainer.addErrorMessage({
message: $t('Payment ' + this.getTitle() + ' can\'t be initialized.')
});
}
}
},

Expand Down
1 change: 0 additions & 1 deletion app/code/Magento/Catalog/etc/mview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
<table name="catalog_product_entity_decimal" entity_column="entity_id" />
<table name="catalog_product_entity_gallery" entity_column="entity_id" />
<table name="catalog_product_entity_int" entity_column="entity_id" />
<table name="catalog_product_entity_media_gallery" entity_column="value_id" />
<table name="catalog_product_entity_media_gallery_value" entity_column="entity_id" />
<table name="catalog_product_entity_text" entity_column="entity_id" />
<table name="catalog_product_entity_tier_price" entity_column="entity_id" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<formElements>
<fileUploader>
<settings>
<allowedExtensions>jpg jpeg gif png svg</allowedExtensions>
<allowedExtensions>jpg jpeg gif png</allowedExtensions>
<maxFileSize>2097152</maxFileSize>
<uploaderConfig>
<param xsi:type="string" name="url">theme/design_config_fileUploader/save</param>
Expand Down Expand Up @@ -87,7 +87,7 @@
<formElements>
<fileUploader>
<settings>
<allowedExtensions>jpg jpeg gif png svg</allowedExtensions>
<allowedExtensions>jpg jpeg gif png</allowedExtensions>
<maxFileSize>2097152</maxFileSize>
<uploaderConfig>
<param xsi:type="string" name="url">theme/design_config_fileUploader/save</param>
Expand Down Expand Up @@ -147,7 +147,7 @@
<formElements>
<fileUploader>
<settings>
<allowedExtensions>jpg jpeg gif png svg</allowedExtensions>
<allowedExtensions>jpg jpeg gif png</allowedExtensions>
<maxFileSize>2097152</maxFileSize>
<uploaderConfig>
<param xsi:type="string" name="url">theme/design_config_fileUploader/save</param>
Expand Down
16 changes: 8 additions & 8 deletions app/code/Magento/CatalogImportExport/Model/Import/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -1228,15 +1228,15 @@ protected function _saveLinks()
'linked_product_id' => $linkedId,
'link_type_id' => $linkId,
];
if (!empty($linkPositions[$linkedKey])) {
$positionRows[] = [
'link_id' => $productLinkKeys[$linkKey],
'product_link_attribute_id' => $positionAttrId[$linkId],
'value' => $linkPositions[$linkedKey],
];
}
$nextLinkId++;
}
if (!empty($linkPositions[$linkedKey])) {
$positionRows[] = [
'link_id' => $productLinkKeys[$linkKey],
'product_link_attribute_id' => $positionAttrId[$linkId],
'value' => $linkPositions[$linkedKey],
];
}
$nextLinkId++;
}
}
}
Expand Down
1 change: 0 additions & 1 deletion app/code/Magento/CatalogRule/etc/mview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<table name="catalog_product_entity_decimal" entity_column="entity_id" />
<table name="catalog_product_entity_gallery" entity_column="entity_id" />
<table name="catalog_product_entity_int" entity_column="entity_id" />
<table name="catalog_product_entity_media_gallery" entity_column="value_id" />
<table name="catalog_product_entity_media_gallery_value" entity_column="entity_id" />
<table name="catalog_product_entity_text" entity_column="entity_id" />
<table name="catalog_product_entity_tier_price" entity_column="entity_id" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(
}

/**
* Generate list based on categories
* Generate product rewrites for anchor categories
*
* @param int $storeId
* @param Product $product
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(ProductUrlPathGenerator $productUrlPathGenerator, Ur
}

/**
* Generate list based on store view
* Generate product rewrites without categories
*
* @param int $storeId
* @param Product $product
Expand Down
Loading

0 comments on commit 322c357

Please sign in to comment.