Skip to content

Commit

Permalink
Merge branch '2.4-develop' into bug/26583-pdp-tier-price-save-percent
Browse files Browse the repository at this point in the history
  • Loading branch information
engcom-Charlie authored Feb 14, 2020
2 parents 62f8c6c + 79ab7c8 commit 0110496
Show file tree
Hide file tree
Showing 869 changed files with 27,878 additions and 5,433 deletions.
3 changes: 1 addition & 2 deletions app/code/Magento/AdvancedPricingImportExport/etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magento_AdvancedPricingImportExport" >
</module>
<module name="Magento_AdvancedPricingImportExport"/>
</config>
2 changes: 1 addition & 1 deletion app/code/Magento/Analytics/Model/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct(
public function execute($commandName)
{
if (!array_key_exists($commandName, $this->commands)) {
throw new NotFoundException(__('Command was not found.'));
throw new NotFoundException(__('Command "%1" was not found.', $commandName));
}

/** @var \Magento\Analytics\Model\Connector\CommandInterface $command */
Expand Down
6 changes: 5 additions & 1 deletion app/code/Magento/Analytics/Test/Unit/Model/ConnectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,13 @@ public function testExecute()
}

/**
* Executing non-existing command
*
* @expectedException \Magento\Framework\Exception\NotFoundException
* @expectedExceptionMessage Command "register" was not found.
* @return void
*/
public function testExecuteCommandNotFound()
public function testExecuteCommandNotFound(): void
{
$commandName = 'register';
$this->connector->execute($commandName);
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Analytics/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"There was an error save new configuration value.","There was an error save new configuration value."
"Please select an industry.","Please select an industry."
"--Please Select--","--Please Select--"
"Command was not found.","Command was not found."
"Command "%1" was not found.","Command "%1" was not found."
"Input data must be string or convertible into string.","Input data must be string or convertible into string."
"Input data must be non-empty string.","Input data must be non-empty string."
"Not valid cipher method.","Not valid cipher method."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Magento\Framework\DataObject;

/**
* Produce html output using the given data source.
*
* phpcs:disable Magento2.Classes.AbstractApi
* Backend grid item abstract renderer
* @api
* @SuppressWarnings(PHPMD.NumberOfChildren)
Expand Down Expand Up @@ -53,7 +56,7 @@ public function getColumn()
* Renders grid column
*
* @param DataObject $row
* @return string
* @return string
*/
public function render(DataObject $row)
{
Expand All @@ -62,7 +65,7 @@ public function render(DataObject $row)
$result .= $this->getColumn()->getEditOnly() ? ''
: '<span class="admin__grid-control-value">' . $this->_getValue($row) . '</span>';

return $result . $this->_getInputValueElement($row) . '</div>' ;
return $result . $this->_getInputValueElement($row) . '</div>';
}
return $this->_getValue($row);
}
Expand Down Expand Up @@ -90,6 +93,7 @@ protected function _getValue(DataObject $row)
if (is_string($getter)) {
return $row->{$getter}();
} elseif (is_callable($getter)) {
//phpcs:ignore Magento2.Functions.DiscouragedFunction
return call_user_func($getter, $row);
}
return '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="LoginActionGroup">
<annotations>
<description>Login to Backend Admin using ENV Admin credentials. PLEASE NOTE: This Action Group does NOT validate that you are Logged In.</description>
<description>DEPRECATED. Please use LoginAsAdmin instead.
Login to Backend Admin using ENV Admin credentials. PLEASE NOTE: This Action Group does NOT validate that you are Logged In.</description>
</annotations>

<amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}" stepKey="navigateToAdmin"/>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/Test/Mftf/Test/AdminLoginTest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
<seeInCurrentUrl url="{{AdminLoginPage.url}}" stepKey="seeAdminLoginUrl"/>
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
</test>
</tests>
</tests>
4 changes: 2 additions & 2 deletions app/code/Magento/Backend/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@
<label>Enable Template Path Hints for Storefront</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="template_hints_storefront_show_with_parameter" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="template_hints_storefront_show_with_parameter" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Enable Hints for Storefront with URL Parameter</label>
<depends>
<field id="*/*/template_hints_storefront">1</field>
</depends>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment>Use URL parameter to enable template path hints for Storefront</comment>
</field>
<field id="template_hints_parameter_value" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<field id="template_hints_parameter_value" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Parameter Value</label>
<depends>
<field id="*/*/template_hints_storefront">1</field>
Expand Down
2 changes: 2 additions & 0 deletions app/code/Magento/Backend/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -461,3 +461,5 @@ Pagination,Pagination
"Alternative text for the next pages link in the pagination menu. If empty, default arrow image is used.","Alternative text for the next pages link in the pagination menu. If empty, default arrow image is used."
"Anchor Text for Next","Anchor Text for Next"
"Theme Name","Theme Name"
"Use URL parameter to enable template path hints for Storefront","Use URL parameter to enable template path hints for Storefront"
"Add the following parameter to the URL to show template hints ?templatehints=[parameter_value]","Add the following parameter to the URL to show template hints ?templatehints=[parameter_value]"
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ define([
* @return {String}
*/
this.translate = function (text) {
return _data[text] ? _data[text] : text;
return typeof _data[text] === 'string' ? _data[text] : text;
};

return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ define([
options.bin = context.paymentPayload.details.bin;
}

if (shippingAddress) {
if (shippingAddress && this.isValidShippingAddress(shippingAddress)) {
options.additionalInformation = {
shippingGivenName: shippingAddress.firstname,
shippingSurname: shippingAddress.lastname,
Expand Down Expand Up @@ -206,6 +206,25 @@ define([
}

return false;
},

/**
* Validate shipping address
*
* @param {Object} shippingAddress
* @return {Boolean}
*/
isValidShippingAddress: function (shippingAddress) {
var isValid = false;

// check that required fields are not empty
if (shippingAddress.firstname && shippingAddress.lastname && shippingAddress.telephone &&
shippingAddress.street && shippingAddress.city && shippingAddress.regionCode &&
shippingAddress.postcode && shippingAddress.countryId) {
isValid = true;
}

return isValid;
}
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ define(
'Magento_Vault/js/view/payment/vault-enabler',
'Magento_Braintree/js/view/payment/kount',
'mage/translate',
'prototype',
'domReady!'
],
function (
Expand Down Expand Up @@ -92,7 +91,7 @@ define(
})
.then(function (hostedFieldsInstance) {
self.hostedFieldsInstance = hostedFieldsInstance;
self.isPlaceOrderActionAllowed(true);
self.isPlaceOrderActionAllowed(false);
self.initFormValidationEvents(hostedFieldsInstance);

return self.hostedFieldsInstance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ define([
*/
onError: function () {
self.showError($t('Payment ' + self.getTitle() + ' can\'t be initialized'));
self.reInitPayPal();
}
}, self.paypalButtonSelector);
},
Expand Down
13 changes: 11 additions & 2 deletions app/code/Magento/Bundle/Observer/AppendUpsellProductsObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

use Magento\Framework\Event\ObserverInterface;

/**
* Class adds bundle products into up-sell products collection
*/
class AppendUpsellProductsObserver implements ObserverInterface
{
/**
Expand Down Expand Up @@ -98,9 +101,15 @@ public function execute(\Magento\Framework\Event\Observer $observer)
}

/* @var $bundleCollection \Magento\Catalog\Model\ResourceModel\Product\Collection */
$bundleCollection = $product->getCollection()->addAttributeToSelect(
$bundleCollection = $product->getCollection();
$bundleCollection->addAttributeToSelect(
$this->config->getProductAttributes()
)->addStoreFilter()->addMinimalPrice()->addFinalPrice()->addTaxPercents()->setVisibility(
);
$bundleCollection->addStoreFilter();
$bundleCollection->addMinimalPrice();
$bundleCollection->addFinalPrice();
$bundleCollection->addTaxPercents();
$bundleCollection->setVisibility(
$this->productVisibility->getVisibleInCatalogIds()
);

Expand Down
11 changes: 8 additions & 3 deletions app/code/Magento/Bundle/Observer/InitOptionRendererObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,25 @@
*/
namespace Magento\Bundle\Observer;

use Magento\Bundle\Helper\Catalog\Product\Configuration;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;

/**
* Initiates render options
*/
class InitOptionRendererObserver implements ObserverInterface
{
/**
* Initialize product options renderer with bundle specific params
*
* @param \Magento\Framework\Event\Observer $observer
* @param Observer $observer
* @return $this
*/
public function execute(\Magento\Framework\Event\Observer $observer)
public function execute(Observer $observer)
{
$block = $observer->getBlock();
$block->addOptionsRenderCfg('bundle', \Magento\Bundle\Helper\Catalog\Product\Configuration::class);
$block->addOptionsRenderCfg('bundle', Configuration::class);
return $this;
}
}
Loading

0 comments on commit 0110496

Please sign in to comment.