Skip to content

Commit

Permalink
Revert "6.4.3 RELEASE FINAL"
Browse files Browse the repository at this point in the history
This reverts commit 31a52faebf3247c07cf7c7e24540aeff8047d4cf.
  • Loading branch information
d-belousov committed Sep 18, 2016
1 parent af32cfd commit b64edef
Show file tree
Hide file tree
Showing 44 changed files with 187 additions and 3,900 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ public function callbackColumnProductTitle($value, $row, $column, $isExport)
{
if (is_null($value)) {
$value = '<i style="color:gray;">receiving...</i>';
} elseif ($value == '') {
$value = '<i style="color:gray;">none</i>';
} else {
$value = '<span>' . Mage::helper('M2ePro')->escapeHtml($value) . '</span>';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,7 @@ public function callbackColumnProductId($value, $row, $column, $isExport)

public function callbackColumnProductTitle($value, $row, $column, $isExport)
{
if (is_null($value)) {
$value = '<i style="color:gray;">receiving...</i>';
} else {
$value = '<span>' .Mage::helper('M2ePro')->escapeHtml($value). '</span>';
}
$value = '<span>'.Mage::helper('M2ePro')->escapeHtml($value).'</span>';

if (!is_null($row->getData('listing_id'))) {
$urlParams = array();
Expand Down
19 changes: 0 additions & 19 deletions app/code/community/Ess/M2ePro/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
* 6.4.4 (r10771) (18/09/2016)

* Added: Ability to install module via composer (composer.json file added)
* Added: Ability to install module via modman (modman file added)
* Added: [Amazon] Ability to create new ASIN/ISBN in Canada Marketplace using Description Policy
* Improvement: [eBay] Variation Options label can be renamed now without further errors from eBay Trading API
* Improvement: [eBay] Preventing the eBay Trading API errors if Magento Child Product will be unassigned from Parent
* Improvement: [eBay] Preventing the eBay Trading API errors if Magento Child Product will be totally removed
* Improvement: [eBay] Price will be sent to the eBay each time during Relist action (together with QTY and Variations Data)
* Fix: Quantity could be calculated incorrectly in some special cases (high limited range of cases)
* Fix: [eBay] Items duplicates because User could List Items with "Listed (Hidden)" status manually
* Fix: [eBay] Orders Synchronization could not work correctly sometimes if there are a lot of changes on eBay side
* Fix: [eBay] Wrong QTY could be set for Item after Relist action for items with "Listed (Hidden)" status
* Fix: [eBay] Excluded locations were not removed from eBay when they were removed from Shipping Policy before
* Fix: [eBay] Error "The Product was Listed as a Simple Product as it has limitation for Multi-Variation Items" during list item even if requirements are met
* Fix: [Amazon] Full revise by Description Policy did not work, if change was performed on Definition tab
* Fix: [Amazon] Synchronization was broken due to error "Call to a member function getOptions() on a non-object"
* Fix: [Amazon/Rakuten.com] Product was not revised if their Policy settings were changed and it was in "Revise in progress" state

* 6.4.3 (r10536) (20/04/2016)

* Improvement: [eBay] If category of listed Item starts to require UPC/EAN/ISBN identifier, M2E will send full Details to prevent an error
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Ess/M2ePro/Helper/Component/Amazon.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public function getMarketplacesAvailableForApiCreation()
public function getMarketplacesAvailableForAsinCreation()
{
$collection = $this->getMarketplacesAvailableForApiCreation();
return $collection->addFieldToFilter('is_new_asin_available', 1);
return $collection->addFieldToFilter('is_asin_available', 1);
}

//########################################
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Ess/M2ePro/Helper/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function getVersion()

public function getRevision()
{
$revision = '10771';
$revision = '10536';

if ($revision == str_replace('|','#','|REVISION|')) {
$revision = (int)exec('svnversion');
Expand Down
3 changes: 1 addition & 2 deletions app/code/community/Ess/M2ePro/Helper/Module/License.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public function getIntervalBeforeExpirationDate($component)
//########################################

public function obtainRecord($email = NULL, $firstName = NULL, $lastName = NULL,
$country = NULL, $city = NULL, $postalCode = NULL, $phone = NULL)
$country = NULL, $city = NULL, $postalCode = NULL)
{
$requestParams = array(
'domain' => Mage::helper('M2ePro/Client')->getDomain(),
Expand All @@ -253,7 +253,6 @@ public function obtainRecord($email = NULL, $firstName = NULL, $lastName = NULL,
!is_null($email) && $requestParams['email'] = $email;
!is_null($firstName) && $requestParams['first_name'] = $firstName;
!is_null($lastName) && $requestParams['last_name'] = $lastName;
!is_null($phone) && $requestParams['phone'] = $phone;
!is_null($country) && $requestParams['country'] = $country;
!is_null($city) && $requestParams['city'] = $city;
!is_null($postalCode) && $requestParams['postal_code'] = $postalCode;
Expand Down
5 changes: 0 additions & 5 deletions app/code/community/Ess/M2ePro/Model/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ public function getTitle()
return $this->getData('title');
}

public function getAdditionalData()
{
return $this->getData('additional_data');
}

/**
* @return bool
*/
Expand Down
2 changes: 0 additions & 2 deletions app/code/community/Ess/M2ePro/Model/Amazon/Listing/Other.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
*/
class Ess_M2ePro_Model_Amazon_Listing_Other extends Ess_M2ePro_Model_Component_Child_Amazon_Abstract
{
const EMPTY_TITLE_PLACEHOLDER = '--';

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

public function _construct()
Expand Down
20 changes: 18 additions & 2 deletions app/code/community/Ess/M2ePro/Model/Amazon/Marketplace.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ public function getDefaultCurrency()
/**
* @return bool
*/
public function isNewAsinAvailable()
public function isAsinAvailable()
{
return (bool)$this->getData('is_new_asin_available');
return (bool)$this->getData('is_asin_available');
}

/**
Expand All @@ -77,6 +77,22 @@ public function isMerchantFulfillmentAvailable()

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

/**
* @return bool
*/
public function isNewAsinAvailable()
{
$newAsinNotImplementedMarketplaces = array(
Ess_M2ePro_Helper_Component_Amazon::MARKETPLACE_CA,
Ess_M2ePro_Helper_Component_Amazon::MARKETPLACE_JP,
Ess_M2ePro_Helper_Component_Amazon::MARKETPLACE_CN,
);

return !in_array((int)$this->getId(),$newAsinNotImplementedMarketplaces);
}

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

public function save()
{
Mage::helper('M2ePro/Data_Cache_Permanent')->removeTagValues('marketplace');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
class Ess_M2ePro_Model_Amazon_Synchronization_Orders_Receive_Requester
extends Ess_M2ePro_Model_Connector_Amazon_Orders_Get_ItemsRequester
{
const TIMEOUT_ERRORS_COUNT_TO_RISE = 3;
const TIMEOUT_RISE_ON_ERROR = 30;
const TIMEOUT_RISE_MAX_VALUE = 1500;

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

/**
Expand Down Expand Up @@ -42,53 +38,4 @@ public function setProcessingLocks(Ess_M2ePro_Model_Processing_Request $processi
}

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

public function process()
{
$cacheConfig = Mage::helper('M2ePro/Module')->getCacheConfig();
$cacheConfigGroup = '/amazon/synchronization/orders/receive/timeout';

try {

parent::process();

} catch (Ess_M2ePro_Model_Exception_Connection $exception) {

$data = $exception->getAdditionalData();
if (!empty($data['curl_error_number']) && $data['curl_error_number'] == CURLE_OPERATION_TIMEOUTED) {

$fails = (int)$cacheConfig->getGroupValue($cacheConfigGroup, 'fails');
$fails++;

$rise = (int)$cacheConfig->getGroupValue($cacheConfigGroup, 'rise');
$rise += self::TIMEOUT_RISE_ON_ERROR;

if ($fails >= self::TIMEOUT_ERRORS_COUNT_TO_RISE && $rise <= self::TIMEOUT_RISE_MAX_VALUE) {

$fails = 0;
$cacheConfig->setGroupValue($cacheConfigGroup, 'rise', $rise);
}
$cacheConfig->setGroupValue($cacheConfigGroup, 'fails', $fails);
}

throw $exception;
}

$cacheConfig->setGroupValue($cacheConfigGroup, 'fails', 0);
}

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

protected function getRequestTimeout()
{
$cacheConfig = Mage::helper('M2ePro/Module')->getCacheConfig();
$cacheConfigGroup = '/amazon/synchronization/orders/receive/timeout';

$rise = (int)$cacheConfig->getGroupValue($cacheConfigGroup, 'rise');
$rise > self::TIMEOUT_RISE_MAX_VALUE && $rise = self::TIMEOUT_RISE_MAX_VALUE;

return 300 + $rise;
}

//########################################
}
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private function updateNotReceivedTitles($neededItems, $responseData) {

$connWrite->update(
$aloTable,
array('title' => Ess_M2ePro_Model_Amazon_Listing_Other::EMPTY_TITLE_PLACEHOLDER),
array('title' => ''),
array('general_id = ?' => (string)$generalId)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,9 @@ protected function performActions()
'Process Account '.$account->getTitle()
);

$params = array();
if (!$this->isFullItemsDataAlreadyReceived($account)) {
$params['full_items_data'] = true;

$additionalData = (array)json_decode($account->getAdditionalData(), true);
$additionalData['is_amazon_other_listings_full_items_data_already_received'] = true;
$account->setSettings('additional_data', $additionalData)->save();
}

$dispatcherObject = Mage::getModel('M2ePro/Connector_Amazon_Dispatcher');
$connectorObj = $dispatcherObject->getConnector('otherListings', 'update' ,'requester',
$params, $account, 'Ess_M2ePro_Model_Amazon_Synchronization');
array(), $account, 'Ess_M2ePro_Model_Amazon_Synchronization');

$dispatcherObject->process($connectorObj);

Expand Down Expand Up @@ -147,11 +138,5 @@ private function isLockedAccount(Ess_M2ePro_Model_Account $account)
return $lockItem->isExist();
}

private function isFullItemsDataAlreadyReceived(Ess_M2ePro_Model_Account $account)
{
$additionalData = (array)json_decode($account->getAdditionalData(), true);
return !empty($additionalData['is_amazon_other_listings_full_items_data_already_received']);
}

//########################################
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ protected function updateReceivedOtherListings($receivedItems)

$newData = array(
'general_id' => (string)$receivedItem['identifiers']['general_id'],
'title' => (string)$receivedItem['title'],
'title' => !empty($receivedItem['title']) ? (string)$receivedItem['title'] : NULL,
'online_price' => (float)$receivedItem['price'],
'online_qty' => (int)$receivedItem['qty'],
'is_afn_channel' => (bool)$receivedItem['channel']['is_afn'],
Expand Down Expand Up @@ -172,10 +172,8 @@ protected function updateReceivedOtherListings($receivedItems)
'status' => (int)$existingItem['status']
);

if (is_null($receivedItem['title']) ||
$receivedItem['title'] == Ess_M2ePro_Model_Amazon_Listing_Other::EMPTY_TITLE_PLACEHOLDER) {

unset($newData['title'], $existingData['title']);
if (is_null($newData['title']) && !is_null($existingData['title'])) {
$newData['title'] = $existingData['title'];
}

if ($newData == $existingData) {
Expand Down Expand Up @@ -302,7 +300,7 @@ protected function createNotExistedOtherListings($receivedItems)
'general_id' => (string)$receivedItem['identifiers']['general_id'],

'sku' => (string)$receivedItem['identifiers']['sku'],
'title' => $receivedItem['title'],
'title' => !empty($receivedItem['title']) ? (string)$receivedItem['title'] : NULL,

'online_price' => (float)$receivedItem['price'],
'online_qty' => (int)$receivedItem['qty'],
Expand All @@ -311,12 +309,6 @@ protected function createNotExistedOtherListings($receivedItems)
'is_isbn_general_id' => (bool)$receivedItem['identifiers']['is_isbn']
);

if (isset($this->params['full_items_data']) && $this->params['full_items_data'] &&
$newData['title'] == Ess_M2ePro_Model_Amazon_Listing_Other::EMPTY_TITLE_PLACEHOLDER) {

$newData['title'] = NULL;
}

if ((bool)$newData['is_afn_channel']) {
$newData['online_qty'] = NULL;
$newData['status'] = Ess_M2ePro_Model_Listing_Product::STATUS_UNKNOWN;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,6 @@ private function executeNeedSynchronize()
$listingProductCollection->addFieldToFilter('synch_status',Ess_M2ePro_Model_Listing_Product::SYNCH_STATUS_NEED);
$listingProductCollection->addFieldToFilter('is_variation_parent', 0);

$tag = 'in_action';
$modelName = Mage::getModel('M2ePro/Listing_Product')->getResourceName();

$listingProductCollection->getSelect()->joinLeft(
array('lo' => Mage::getResourceModel('M2ePro/LockedObject')->getMainTable()),
"lo.object_id = main_table.id AND lo.tag='{$tag}' AND lo.model_name = '{$modelName}'",
array()
);
$listingProductCollection->addFieldToFilter('lo.id', array('null' => true));

$listingProductCollection->getSelect()->limit(100);

/** @var $listingProduct Ess_M2ePro_Model_Listing_Product */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,6 @@ public function setMarketplace(Ess_M2ePro_Model_Marketplace $instance)

// ---------------------------------------

public function setDefinitionTemplate(Ess_M2ePro_Model_Amazon_Template_Description_Definition $template)
{
$this->descriptionDefinitionModel = $template;
return $this;
}

/**
* @return Ess_M2ePro_Model_Amazon_Template_Description_Definition
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,6 @@ private function executeNeedSynchronize()
$listingProductCollection->addFieldToFilter('status', Ess_M2ePro_Model_Listing_Product::STATUS_LISTED);
$listingProductCollection->addFieldToFilter('synch_status',Ess_M2ePro_Model_Listing_Product::SYNCH_STATUS_NEED);

$tag = 'in_action';
$modelName = Mage::getModel('M2ePro/Listing_Product')->getResourceName();

$listingProductCollection->getSelect()->joinLeft(
array('lo' => Mage::getResourceModel('M2ePro/LockedObject')->getMainTable()),
"lo.object_id = main_table.id AND lo.tag='{$tag}' AND lo.model_name = '{$modelName}'",
array()
);
$listingProductCollection->addFieldToFilter('lo.id', array('null' => true));

$listingProductCollection->getSelect()->limit(100);

/** @var $listingProduct Ess_M2ePro_Model_Listing_Product */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ protected function getResponserParams()

protected function getRequestData()
{
$requestData = array();
if (isset($this->params['full_items_data'])) {
$requestData['full_items_data'] = $this->params['full_items_data'];
}

return $requestData;
return array();
}

//########################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,6 @@ protected function filterManualListingsProducts()
continue;
}

if ($listingProduct->isHidden()) {

$message = array(
// M2ePro_TRANSLATIONS
// The List action cannot be executed for this Item as it has a Listed (Hidden) status. You have to stop Item manually first to run the List action for it.
parent::MESSAGE_TEXT_KEY => 'The List action cannot be executed for this Item as it has
a Listed (Hidden) status. You have to stop Item manually first
to run the List action for it.',
parent::MESSAGE_TYPE_KEY => parent::MESSAGE_TYPE_ERROR
);

$this->getLogger()->logListingProductMessage(
$listingProduct, $message, Ess_M2ePro_Model_Log_Abstract::PRIORITY_MEDIUM
);

$this->removeAndUnlockListingProduct($listingProduct);
continue;
}

if (!$listingProduct->getChildObject()->isSetCategoryTemplate()) {

$message = array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,6 @@ protected function filterManualListingProduct()
return false;
}

if ($this->listingProduct->isHidden()) {

$message = array(
// M2ePro_TRANSLATIONS
// The List action cannot be executed for this Item as it has a Listed (Hidden) status. You have to stop Item manually first to run the List action for it.
parent::MESSAGE_TEXT_KEY => 'The List action cannot be executed for this Item as it has
a Listed (Hidden) status. You have to stop Item manually first
to run the List action for it.',
parent::MESSAGE_TYPE_KEY => parent::MESSAGE_TYPE_ERROR
);

$this->getLogger()->logListingProductMessage(
$this->listingProduct, $message, Ess_M2ePro_Model_Log_Abstract::PRIORITY_MEDIUM
);

return false;
}

if (!$this->listingProduct->getChildObject()->isSetCategoryTemplate()) {

$message = array(
Expand Down
Loading

0 comments on commit b64edef

Please sign in to comment.