Skip to content

Commit a553f32

Browse files
committed
Merge branch 'develop' into release/6.4.24
2 parents 5737f61 + 79cde72 commit a553f32

5 files changed

Lines changed: 34 additions & 21 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ You are welcome to contribute to Engagement Cloud for Magento! You can either:
4141
- Fix a bug: please fork this repo and submit the Pull Request to our [Develop branch](https://github.com/dotmailer/dotmailer-magento-extension/tree/develop)
4242
Request a feature on our [roadmap](https://roadmap.dotdigital.com)
4343

44+
# 6.4.24
45+
46+
###### What's new
47+
- We've increased the sync limits for bulk imports into Engagement Cloud. The importer sync will now import up to 100 bulk items on each execution (25 of which can be for contacts), plus up to 100 single items.
48+
49+
###### Bug fixes
50+
- We fixed a filename casing error that broke the page at Configuration > Engagement Cloud > Dynamic Content.
51+
4452
# 6.4.23
4553

4654
###### What's new
@@ -51,6 +59,7 @@ Request a feature on our [roadmap](https://roadmap.dotdigital.com)
5159

5260
###### Bug fixes
5361
- We've fixed an error with updating products following an order sync - an exception was thrown once all available orders had been synced.
62+
- We changed a line in our `UrlFinder` class that was causing a fatal error in PHP 5.4.
5463

5564
# 6.4.22
5665

code/Dotdigitalgroup/Email/Block/Adminhtml/System/Dynamic/SubheadingWithComment.php renamed to code/Dotdigitalgroup/Email/Block/Adminhtml/System/Dynamic/Subheadingwithcomment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* @author Magento Core Team <core@magentocommerce.com>
77
*/
8-
class Dotdigitalgroup_Email_Block_Adminhtml_System_Dynamic_SubheadingWithComment
8+
class Dotdigitalgroup_Email_Block_Adminhtml_System_Dynamic_Subheadingwithcomment
99
extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
1010
{
1111
/**

code/Dotdigitalgroup/Email/Model/Importer.php

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ class Dotdigitalgroup_Email_Model_Importer extends Mage_Core_Model_Abstract
3030
const IMPORT_TYPE_SUBSCRIBER_RESUBSCRIBED = 'Subscriber';
3131

3232
//sync limits
33-
const SYNC_SINGLE_LIMIT_NUMBER = 100;
33+
const TOTAL_IMPORT_SYNC_LIMIT = 100;
34+
const CONTACT_IMPORT_SYNC_LIMIT = 25;
3435

3536
/**
3637
* @var array
@@ -59,7 +60,6 @@ class Dotdigitalgroup_Email_Model_Importer extends Mage_Core_Model_Abstract
5960
public $bulkPriority;
6061
public $singlePriority;
6162
public $totalItems;
62-
public $bulkSyncLimit;
6363

6464
/**
6565
* Constructor.
@@ -127,7 +127,7 @@ protected function _checkImportStatus()
127127
{
128128
$helper = Mage::helper('ddg');
129129
$helper->allowResourceFullExecution();
130-
if ($items = $this->_getImportingItems($this->bulkSyncLimit)) {
130+
if ($items = $this->_getImportingItems(self::TOTAL_IMPORT_SYNC_LIMIT)) {
131131
foreach ($items as $item) {
132132
$websiteId = $item->getWebsiteId();
133133
$client = Mage::helper('ddg')->getWebsiteApiClient($websiteId);
@@ -238,9 +238,6 @@ public function processQueue()
238238
//Set items to 0
239239
$this->totalItems = 0;
240240

241-
//Set bulk sync limit
242-
$this->bulkSyncLimit = 5;
243-
244241
//Set priority
245242
$this->_setPriority();
246243

@@ -249,37 +246,39 @@ public function processQueue()
249246

250247
$enabledWebsiteIds = $this->getEnabledWebsiteIds();
251248

252-
//Bulk priority. Process group 1 first
249+
//Bulk priority. Process Contact Bulk first
253250
foreach ($this->bulkPriority as $bulk) {
254-
if ($this->totalItems < $bulk['limit']) {
251+
if ($this->totalItems < self::TOTAL_IMPORT_SYNC_LIMIT) {
252+
// only Contact imports have a bulk limit
253+
$bulkLimit = isset($bulk['limit']) ? $bulk['limit'] - $this->totalItems : self::TOTAL_IMPORT_SYNC_LIMIT - $this->totalItems;
255254
$collection = $this->_getQueue(
256255
$bulk['type'],
257256
$bulk['mode'],
258-
$bulk['limit'] - $this->totalItems,
257+
$bulkLimit,
259258
$enabledWebsiteIds
260259
);
261260
if ($collection->getSize()) {
262-
$this->totalItems += $collection->getSize();
261+
$this->totalItems += count($collection);
263262
$bulkModel = Mage::getModel($bulk['model']);
264263
$bulkModel->processCollection($collection);
265264
}
266265
}
267266
}
268267

269-
//reset total items to 0
268+
//reset total items
270269
$this->totalItems = 0;
271270

272271
//Single/Update priority
273272
foreach ($this->singlePriority as $single) {
274-
if ($this->totalItems < $single['limit']) {
273+
if ($this->totalItems < self::TOTAL_IMPORT_SYNC_LIMIT) {
275274
$collection = $this->_getQueue(
276275
$single['type'],
277276
$single['mode'],
278-
$single['limit'] - $this->totalItems,
277+
self::TOTAL_IMPORT_SYNC_LIMIT - $this->totalItems,
279278
$enabledWebsiteIds
280279
);
281280
if ($collection->getSize()) {
282-
$this->totalItems += $collection->getSize();
281+
$this->totalItems += count($collection);
283282
$singleModel = Mage::getModel($single['model']);
284283
$singleModel->processCollection($collection);
285284
}
@@ -301,7 +300,6 @@ protected function _setPriority()
301300
'model' => '',
302301
'mode' => self::MODE_BULK,
303302
'type' => '',
304-
'limit' => $this->bulkSyncLimit
305303
);
306304

307305
//Contact Bulk
@@ -312,6 +310,7 @@ protected function _setPriority()
312310
self::IMPORT_TYPE_GUEST,
313311
self::IMPORT_TYPE_SUBSCRIBERS
314312
);
313+
$contact['limit'] = self::CONTACT_IMPORT_SYNC_LIMIT;
315314

316315
//Bulk Order
317316
$order = $defaultBulk;
@@ -339,7 +338,6 @@ protected function _setPriority()
339338
'model' => 'ddg_automation/sync_contact_update',
340339
'mode' => '',
341340
'type' => '',
342-
'limit' => self::SYNC_SINGLE_LIMIT_NUMBER
343341
);
344342

345343
//Subscriber resubscribe
@@ -385,7 +383,6 @@ protected function _setPriority()
385383
'model' => '',
386384
'mode' => '',
387385
'type' => '',
388-
'limit' => self::SYNC_SINGLE_LIMIT_NUMBER
389386
);
390387

391388
//Contact Delete

code/Dotdigitalgroup/Email/Model/Sync/Contact/Bulk.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,15 @@ protected function _handleItemAfterSync($item, $result)
7676
->save();
7777
} else {
7878
$message = (isset($result->message)) ? $result->message : 'Error unknown';
79-
$item->setImportStatus(Dotdigitalgroup_Email_Model_Importer::FAILED)
80-
->setMessage($message);
79+
80+
// Requeue imports if import limit has been exceeded
81+
if (strpos($message, 'ERROR_IMPORT_TOOMANYACTIVEIMPORTS') !== false) {
82+
$item->setImportStatus(Dotdigitalgroup_Email_Model_Importer::NOT_IMPORTED);
83+
} else {
84+
$item->setImportStatus(Dotdigitalgroup_Email_Model_Importer::FAILED);
85+
}
86+
87+
$item->setMessage($message);
8188

8289
//If result id
8390
if (isset($result->id)) {

code/Dotdigitalgroup/Email/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<config>
33
<modules>
44
<Dotdigitalgroup_Email>
5-
<version>6.4.23</version>
5+
<version>6.4.24</version>
66
</Dotdigitalgroup_Email>
77
</modules>
88
<frontend>

0 commit comments

Comments
 (0)