Skip to content

Commit

Permalink
6.21.3 (FINAL RELEASE)
Browse files Browse the repository at this point in the history
  • Loading branch information
m2epro committed Apr 27, 2022
1 parent 74bfba5 commit 83465ed
Show file tree
Hide file tree
Showing 53 changed files with 155 additions and 308 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ public function callbackColumnProductTitle($value, $row, $column, $isExport)

foreach ($productOptions as $attribute => $option) {
$attribute = $dataHelper->escapeHtml($attribute);
!$option && $option = '--';
if ($option === '' || $option === null) {
$option = '--';
}
$option = $dataHelper->escapeHtml($option);

$optionsStr .= <<<HTML
Expand Down Expand Up @@ -872,4 +874,4 @@ protected function getChildListingProductIds($row)
}

//########################################
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function getAttributesOptionsFromVariations($variations)
$attributesOptions[$attr] = array();
}

if (!in_array($option, $attributesOptions[$attr])) {
if (!in_array($option, $attributesOptions[$attr], true)) {
$attributesOptions[$attr][] = $option;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,17 +351,20 @@ public function callbackColumnProductOptions($additionalData, $row, $column, $is

foreach ($productOptions as $attribute => $option) {
$style = '';
if (in_array($attribute, $virtualProductAttributes)) {
if (in_array($attribute, $virtualProductAttributes, true)) {
$style = 'border-bottom: 2px dotted grey';
}

!$option && $option = '--';
if ($option === '' || $option === null) {
$option = '--';
}

$optionHtml = '<span class="attribute-row" style="' . $style . '"><span class="attribute"><strong>' .
Mage::helper('M2ePro')->escapeHtml($attribute) .
'</strong></span>:&nbsp;<span class="value">' . Mage::helper('M2ePro')->escapeHtml($option) .
'</span></span>';

if ($uniqueProductsIds && $option !== '--' && !in_array($attribute, $virtualProductAttributes)) {
if ($uniqueProductsIds && $option !== '--' && !in_array($attribute, $virtualProductAttributes, true)) {
$url = $this->getUrl('adminhtml/catalog_product/edit', array('id' => $productsIds[$attribute]));
$html .= '<a href="' . $url . '" target="_blank">' . $optionHtml . '</a><br/>';
} else {
Expand All @@ -385,7 +388,7 @@ public function callbackColumnProductOptions($additionalData, $row, $column, $is
$linkContent = Mage::helper('M2ePro')->__('Change Variation');

$attributes = Mage::helper('M2ePro')->escapeHtml(Mage::helper('M2ePro')->jsonEncode($attributes));
$variationsTree = Mage::helper('M2ePro')->escapeHtml(Mage::helper('M2ePro')->jsonEncode($variationsTree));
$variationsTree = Mage::helper('M2ePro')->escapeHtml(json_encode($variationsTree, JSON_FORCE_OBJECT));

$html .= <<<HTML
<form action="javascript:void(0);" class="product-options-edit"></form>
Expand Down Expand Up @@ -465,11 +468,13 @@ public function callbackColumnChannelOptions($additionalData, $row, $column, $is

foreach ($options as $attribute => $option) {
$style = '';
if (in_array($attribute, $virtualChannelAttributes)) {
if (in_array($attribute, $virtualChannelAttributes, true)) {
$style = 'border-bottom: 2px dotted grey';
}

!$option && $option = '--';
if ($option === '' || $option === null) {
$option = '--';
}

$attrName = Mage::helper('M2ePro')->escapeHtml($attribute);
$optionName = Mage::helper('M2ePro')->escapeHtml($option);
Expand Down Expand Up @@ -1341,7 +1346,7 @@ public function getAttributesVariationsSets($variations)
$attributesOptions[$attr] = array();
}

if (!in_array($option, $attributesOptions[$attr])) {
if (!in_array($option, $attributesOptions[$attr], true)) {
$attributesOptions[$attr][] = $option;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,9 @@ public function callbackColumnProductTitle($productTitle, $row, $column, $isExpo
if (!empty($productOptions)) {
$value .= '<div style="font-size: 11px; color: grey; margin-left: 7px"><br/>';
foreach ($productOptions as $attribute => $option) {
!$option && $option = '--';
if ($option === '' || $option === null) {
$option = '--';
}
$value .= '<strong>' . $helper->escapeHtml($attribute) .
'</strong>:&nbsp;' . $helper->escapeHtml($option) . '<br/>';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,9 @@ public function callbackColumnProductTitle($productTitle, $row, $column, $isExpo
$style = 'border-bottom: 2px dotted grey';
}

!$option && $option = '--';
if ($option === '' || $option === null) {
$option = '--';
}
$value .= '<span style="' . $style . '"><b>' . Mage::helper('M2ePro')->escapeHtml($attribute) .
'</b>:&nbsp;' . Mage::helper('M2ePro')->escapeHtml($option) . '</span><br/>';
}
Expand All @@ -476,7 +478,9 @@ public function callbackColumnProductTitle($productTitle, $row, $column, $isExpo
$style = 'border-bottom: 2px dotted grey';
}

!$option && $option = '--';
if ($option === '' || $option === null) {
$option = '--';
}
$value .= '<span style="' . $style . '"><b>' . Mage::helper('M2ePro')->escapeHtml($attribute) .
'</b>:&nbsp;' . Mage::helper('M2ePro')->escapeHtml($option) . '</span><br/>';
}
Expand All @@ -494,7 +498,9 @@ public function callbackColumnProductTitle($productTitle, $row, $column, $isExpo

$value .= '<div style="font-size: 11px; color: grey; margin-left: 7px"><br/>';
foreach ($productOptions as $attribute => $option) {
!$option && $option = '--';
if ($option === '' || $option === null) {
$option = '--';
}
$value .= '<b>' . Mage::helper('M2ePro')->escapeHtml($attribute) .
'</b>:&nbsp;' . Mage::helper('M2ePro')->escapeHtml($option) . '<br/>';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,9 @@ public function callbackColumnProductTitle($productTitle, $row, $column, $isExpo
if (!empty($productOptions)) {
$value .= '<div style="font-size: 11px; color: grey; margin-left: 7px"><br/>';
foreach ($productOptions as $attribute => $option) {
!$option && $option = '--';
if ($option === '' || $option === null) {
$option = '--';
}
$value .= '<strong>' . Mage::helper('M2ePro')->escapeHtml($attribute) .
'</strong>:&nbsp;' . Mage::helper('M2ePro')->escapeHtml($option) . '<br/>';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@ public function callbackColumnProductTitleID($value, $row, $column, $isExport)

$value .= '<div style="font-size: 11px; color: grey;">';
foreach ($additionalData['variation_options'] as $attribute => $option) {
!$option && $option = '--';
if ($option === '' || $option === null) {
$option = '--';
}
$value .= '<strong>'.
Mage::helper('M2ePro')->escapeHtml($attribute) .
'</strong>:&nbsp;'.
Expand All @@ -291,7 +293,9 @@ public function callbackColumnAttributes($value, $row, $column, $isExport)

$result = '<div style="font-size: 11px; color: grey;">';
foreach ($additionalData['variation_options'] as $attribute => $option) {
!$option && $option = '--';
if ($option === '' || $option === null) {
$option = '--';
}
$result .= '<strong>'.
Mage::helper('M2ePro')->escapeHtml($attribute) .
'</strong>:&nbsp;'.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ protected function _beforeToHtml()
} else {
foreach ($magentoVariations as $magentoVariation) {
$magentoOptionLabel = array_shift($magentoVariation['labels']);
if (!$magentoOptionLabel) {
$magentoOptionLabel = Mage::helper('M2ePro')->__('N/A');
if ($magentoValueLabel === '' || $magentoValueLabel === null) {
$magentoValueLabel = Mage::helper('M2ePro')->__('N/A');
}

$magentoOption = array(
Expand All @@ -120,7 +120,7 @@ protected function _beforeToHtml()

foreach ($magentoVariation['values'] as $magentoOptionValue) {
$magentoValueLabel = array_shift($magentoOptionValue['labels']);
if (!$magentoValueLabel) {
if ($magentoValueLabel === '' || $magentoValueLabel === null) {
$magentoValueLabel = Mage::helper('M2ePro')->__('N/A');
}

Expand Down Expand Up @@ -153,4 +153,4 @@ protected function _beforeToHtml()
}

//########################################
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ public function callbackColumnProductTitle($value, $row, $column, $isExport)

foreach ($productOptions as $attribute => $option) {
$attribute = $dataHelper->escapeHtml($attribute);
!$option && $option = '--';
if ($option === '' || $option === null) {
$option = '--';
}
$option = $dataHelper->escapeHtml($option);

$optionsStr .= <<<HTML
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function getAttributesOptionsFromVariations($variations)
$attributesOptions[$attr] = array();
}

if (!in_array($option, $attributesOptions[$attr])) {
if (!in_array($option, $attributesOptions[$attr], true)) {
$attributesOptions[$attr][] = $option;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,9 @@ public function callbackColumnProductOptions($additionalData, $row, $column, $is
$style = 'border-bottom: 2px dotted grey';
}

!$option && $option = '--';
if ($option === '' || $option === null) {
$option = '--';
}
$optionHtml = '<span class="attribute-row" style="' . $style . '"><span class="attribute"><strong>' .
Mage::helper('M2ePro')->escapeHtml($attribute) .
'</strong></span>:&nbsp;<span class="value">' . Mage::helper('M2ePro')->escapeHtml($option) .
Expand Down Expand Up @@ -478,7 +480,9 @@ public function callbackColumnChannelOptions($additionalData, $row, $column, $is
$style = 'border-bottom: 2px dotted grey';
}

!$option && $option = '--';
if ($option === '' || $option === null) {
$option = '--';
}

$attrName = Mage::helper('M2ePro')->escapeHtml($attribute);
$optionName = Mage::helper('M2ePro')->escapeHtml($option);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,9 @@ public function callbackColumnProductTitle($productTitle, $row, $column, $isExpo
if (!empty($productOptions)) {
$value .= '<div style="font-size: 11px; color: grey; margin-left: 7px"><br/>';
foreach ($productOptions as $attribute => $option) {
!$option && $option = '--';
if ($option === '' || $option === null) {
$option = '--';
}
$value .= '<strong>' . Mage::helper('M2ePro')->escapeHtml($attribute) .
'</strong>:&nbsp;' . Mage::helper('M2ePro')->escapeHtml($option) . '<br/>';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,9 @@ public function callbackColumnProductTitle($productTitle, $row, $column, $isExpo
if (!empty($productOptions)) {
$value .= '<div style="font-size: 11px; color: grey; margin-left: 7px"><br/>';
foreach ($productOptions as $attribute => $option) {
!$option && $option = '--';
if ($option === '' || $option === null) {
$option = '--';
}
$value .= '<strong>' . $helper->escapeHtml($attribute) .
'</strong>:&nbsp;' . $helper->escapeHtml($option) . '<br/>';
}
Expand Down
16 changes: 11 additions & 5 deletions app/code/community/Ess/M2ePro/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
* 6.21.2 (13/04/2022)
* 6.21.3 (27/04/2022)

Common: [Fixed] Issues with listing and mapping orders for Configurable Products with zero (0, 00, 000) size variations [#3350]
eBay: [Fixed] "Invalid block type: Ess\M2ePro\Block\Adminhtml\Wizard\InstallationEbay\Notification" when downloading Rate Tables in the Shipping Policy [#3030]
Amazon: [Fixed] Unable to save configurations when the VAT Invoice Creation option is set to "I will upload my own Invoices"[#3535]

* 6.21.2 (13/04/2022)

Common: [Improved] Some UI text updates [#3486]
eBay: [Fixed] Fatal error occurred when moving products from Unmanaged Listing to the M2E Pro Listing [#3436]

* 6.21.1 (05/04/2022)

Common [Fixed] Unable to set a decimal value in the "VAT Rate" field in the Selling Policy [#3100]
eBay [Fixed] Incorrect mapping of floating-point variations when creating a Magento Order [#3108]
eBay [Fixed] Repetitive automatic Revise of eBay Parts Compatibility [#3427}
eBay [Fixed] Item ID is displayed as N/A for some products [#2990]
Common: [Fixed] Unable to set a decimal value in the "VAT Rate" field in the Selling Policy [#3100]
eBay: [Fixed] Incorrect mapping of floating-point variations when creating a Magento Order [#3108]
eBay: [Fixed] Repetitive automatic Revise of eBay Parts Compatibility [#3427}
eBay: [Fixed] Item ID is displayed as N/A for some products [#2990]

* 6.21.0 (23/03/2022)

Expand Down
88 changes: 1 addition & 87 deletions app/code/community/Ess/M2ePro/Helper/Module/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@

class Ess_M2ePro_Helper_Module_Exception extends Mage_Core_Helper_Abstract
{
const FILTER_TYPE_TYPE = 1;
const FILTER_TYPE_INFO = 2;
const FILTER_TYPE_MESSAGE = 3;

protected $systemLogTableName;

//########################################

public function process(Exception $exception, $sendToServer = true)
public function process(Exception $exception)
{
try {
$class = get_class($exception);
Expand All @@ -34,27 +31,6 @@ public function process(Exception $exception, $sendToServer = true)
$info
);

$sendConfig = (bool)(int)Mage::helper('M2ePro/Module')->getConfig()
->getGroupValue('/server/exceptions/', 'send');

if (!$sendToServer ||
($exception instanceof Ess_M2ePro_Model_Exception && !$exception->isSendToServer()) ||
!$sendConfig || $this->isExceptionFiltered($info, $exception->getMessage(), $class)
) {
return;
}

$temp = Mage::helper('M2ePro/Data_Global')->getValue('send_exception_to_server');
if (!empty($temp)) {
return;
}

Mage::helper('M2ePro/Data_Global')->setValue('send_exception_to_server', true);

$this->send($info, $exception->getMessage(), $class);

Mage::helper('M2ePro/Data_Global')->unsetValue('send_exception_to_server');

// @codingStandardsIgnoreLine
} catch (Exception $exceptionTemp) {
}
Expand Down Expand Up @@ -85,24 +61,6 @@ public function processFatal($error, $traceInfo)
$info
);

$sendConfig = (bool)(int)Mage::helper('M2ePro/Module')->getConfig()
->getGroupValue('/server/fatal_error/', 'send');

if (!$sendConfig || $this->isExceptionFiltered($info, $error['message'], $class)) {
return;
}

$temp = Mage::helper('M2ePro/Data_Global')->getValue('send_exception_to_server');
if (!empty($temp)) {
return;
}

Mage::helper('M2ePro/Data_Global')->setValue('send_exception_to_server', true);

$this->send($info, $error['message'], $class);

Mage::helper('M2ePro/Data_Global')->unsetValue('send_exception_to_server');

// @codingStandardsIgnoreLine
} catch (Exception $exceptionTemp) {
}
Expand Down Expand Up @@ -332,48 +290,4 @@ protected function getAdditionalActionInfo()
}

//########################################

protected function send($info, $message, $type)
{
$dispatcherObject = Mage::getModel('M2ePro/M2ePro_Connector_Dispatcher');
$connectorObj = $dispatcherObject->getVirtualConnector(
'exception', 'add', 'entity',
array(
'info' => $info,
'message' => $message,
'type' => $type
)
);

$dispatcherObject->process($connectorObj);
}

protected function isExceptionFiltered($info, $message, $type)
{
if (!(bool)(int)Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/server/exceptions/', 'filters')) {
return false;
}

$exceptionFilters = Mage::helper('M2ePro/Module')->getRegistry()->getValueFromJson('/exceptions_filters/');
foreach ($exceptionFilters as $exceptionFilter) {
try {
$searchSubject = '';
$exceptionFilter['type'] == self::FILTER_TYPE_TYPE && $searchSubject = $type;
$exceptionFilter['type'] == self::FILTER_TYPE_MESSAGE && $searchSubject = $message;
$exceptionFilter['type'] == self::FILTER_TYPE_INFO && $searchSubject = $info;

$tempResult = preg_match($exceptionFilter['preg_match'], $searchSubject);
} catch (Exception $exception) {
return false;
}

if ($tempResult) {
return true;
}
}

return false;
}

//########################################
}
Loading

0 comments on commit 83465ed

Please sign in to comment.