NL2go_Sync - Version 1.2.1

Version Notes

Hotfix: Table prefixes do not break the plugin anymore.

Download this release

Release Info

Developer Magento Core Team
Extension NL2go_Sync
Version 1.2.1
Comparing to
See all releases


Code changes from version 1.2.0 to 1.2.1

app/code/local/NL2go/Sync/Model/Newsletter/Api/V2.php CHANGED
@@ -154,16 +154,18 @@ class Nl2go_Sync_Model_Newsletter_Api_V2 extends Mage_Api_Model_Resource_Abstrac
154
  $resource = Mage::getSingleton('core/resource');
155
  /* Retrieve the read connection */
156
  $readConnection = $resource->getConnection('core_read');
157
-
 
158
  // it is impossible to filter subscribers by date, because there are cases when the dates are NULL
159
  // get all subscribers
160
 
 
161
  if($hours==0){
162
- $query = "SELECT * FROM newsletter_subscriber ".
163
  " WHERE subscriber_status=".Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED.
164
  " AND customer_id=0";
165
  } else {
166
- $query = "SELECT * FROM newsletter_subscriber ".
167
  " WHERE customer_id=0 AND (change_status_at IS NULL OR change_status_at BETWEEN TIMESTAMP(DATE_SUB(NOW(), INTERVAL ".$hours." HOUR)) AND TIMESTAMP(NOW()))";
168
  }
169
 
@@ -185,17 +187,19 @@ class Nl2go_Sync_Model_Newsletter_Api_V2 extends Mage_Api_Model_Resource_Abstrac
185
  $resource = Mage::getSingleton('core/resource');
186
  /* Retrieve the read connection */
187
  $readConnection = $resource->getConnection('core_read');
 
 
188
 
189
  /* Retrieve our data for customers */
190
  if($hours==0){
191
- $query = "SELECT * FROM newsletter_subscriber WHERE customer_id!=0";
192
  if($subscribed_only) {
193
  $query .= " AND subscriber_status=" . Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED;
194
  }
195
  } else {
196
- $query = "SELECT * FROM newsletter_subscriber ".
197
  " WHERE customer_id IN(".
198
- "SELECT entity_id FROM customer_entity ".
199
  " WHERE created_at BETWEEN TIMESTAMP(DATE_SUB(NOW(), INTERVAL ".$hours." HOUR)) AND TIMESTAMP(NOW()) OR ".
200
  " updated_at BETWEEN TIMESTAMP(DATE_SUB(NOW(), INTERVAL ".$hours." HOUR)) AND TIMESTAMP(NOW())".
201
  ")";
154
  $resource = Mage::getSingleton('core/resource');
155
  /* Retrieve the read connection */
156
  $readConnection = $resource->getConnection('core_read');
157
+ $table = $resource->getTableName('newsletter/subscriber');
158
+
159
  // it is impossible to filter subscribers by date, because there are cases when the dates are NULL
160
  // get all subscribers
161
 
162
+
163
  if($hours==0){
164
+ $query = "SELECT * FROM $table ".
165
  " WHERE subscriber_status=".Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED.
166
  " AND customer_id=0";
167
  } else {
168
+ $query = "SELECT * FROM $table ".
169
  " WHERE customer_id=0 AND (change_status_at IS NULL OR change_status_at BETWEEN TIMESTAMP(DATE_SUB(NOW(), INTERVAL ".$hours." HOUR)) AND TIMESTAMP(NOW()))";
170
  }
171
 
187
  $resource = Mage::getSingleton('core/resource');
188
  /* Retrieve the read connection */
189
  $readConnection = $resource->getConnection('core_read');
190
+ $table = $resource->getTableName('newsletter/subscriber');
191
+ $tableCustomer = $resource->getTableName('customer/entity');
192
 
193
  /* Retrieve our data for customers */
194
  if($hours==0){
195
+ $query = "SELECT * FROM $table WHERE customer_id!=0";
196
  if($subscribed_only) {
197
  $query .= " AND subscriber_status=" . Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED;
198
  }
199
  } else {
200
+ $query = "SELECT * FROM $table ".
201
  " WHERE customer_id IN(".
202
+ "SELECT entity_id FROM $tableCustomer ".
203
  " WHERE created_at BETWEEN TIMESTAMP(DATE_SUB(NOW(), INTERVAL ".$hours." HOUR)) AND TIMESTAMP(NOW()) OR ".
204
  " updated_at BETWEEN TIMESTAMP(DATE_SUB(NOW(), INTERVAL ".$hours." HOUR)) AND TIMESTAMP(NOW())".
205
  ")";
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>NL2go_Sync</name>
4
- <version>1.2.0</version>
5
  <stability>stable</stability>
6
  <license/>
7
  <channel>community</channel>
@@ -15,11 +15,11 @@ On top you can easily retrieve all item data including description, price info,
15
  &lt;p&gt;Get the extension key on this site and install the Newsletter2Go Magento Extension in your Magento shop. &lt;br /&gt;&#xD;
16
  Set up a new API user and insert the information under settings on the Newsletter2Go web site.&#xD;
17
  &lt;/p&gt;</description>
18
- <notes>Synchronize all customers to manage unsubscriptions.</notes>
19
  <authors><author><name>Steffen</name><user>auto-converted</user><email>info@newsletter2go.de</email></author></authors>
20
- <date>2014-03-07</date>
21
- <time>16:51:49</time>
22
- <contents><target name="magelocal"><dir name="NL2go"><dir name="Sync"><dir name="Model"><dir name="Newsletter"><dir name="Api"><file name="V2.php" hash="b31295a02abc2152c099257a2e318da1"/></dir><file name="Api.php" hash="0139d3b2ef2ed98a10b3d7a14b6f7959"/></dir></dir><dir name="etc"><file name="api.xml" hash="7e11289db23d52088f15c1654b35f3a8"/><file name="config.xml" hash="534eb47f4db745e8b5210c1dfb5ca40a"/><file name="wsdl.xml" hash="832c7c111c26ec94ee59ccdca064282c"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="NL2go_Sync.xml" hash="93aca69e7ba45a5664e4bcd277aa775b"/></dir></target></contents>
23
  <compatible/>
24
  <dependencies/>
25
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>NL2go_Sync</name>
4
+ <version>1.2.1</version>
5
  <stability>stable</stability>
6
  <license/>
7
  <channel>community</channel>
15
  &lt;p&gt;Get the extension key on this site and install the Newsletter2Go Magento Extension in your Magento shop. &lt;br /&gt;&#xD;
16
  Set up a new API user and insert the information under settings on the Newsletter2Go web site.&#xD;
17
  &lt;/p&gt;</description>
18
+ <notes>Hotfix: Table prefixes do not break the plugin anymore.</notes>
19
  <authors><author><name>Steffen</name><user>auto-converted</user><email>info@newsletter2go.de</email></author></authors>
20
+ <date>2014-03-10</date>
21
+ <time>11:25:00</time>
22
+ <contents><target name="magelocal"><dir name="NL2go"><dir name="Sync"><dir name="Model"><dir name="Newsletter"><dir name="Api"><file name="V2.php" hash="7ad9477a200299888976b8177715690d"/></dir><file name="Api.php" hash="0139d3b2ef2ed98a10b3d7a14b6f7959"/></dir></dir><dir name="etc"><file name="api.xml" hash="7e11289db23d52088f15c1654b35f3a8"/><file name="config.xml" hash="534eb47f4db745e8b5210c1dfb5ca40a"/><file name="wsdl.xml" hash="832c7c111c26ec94ee59ccdca064282c"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="NL2go_Sync.xml" hash="93aca69e7ba45a5664e4bcd277aa775b"/></dir></target></contents>
23
  <compatible/>
24
  <dependencies/>
25
  </package>