Mage_Laposta_Connect - Version 1.0.14

Version Notes

- Fixed bug with subscription observer in Magento CE 1.9.1.1
- Tested for compatibility with Magento CE 1.9.1.1

Download this release

Release Info

Developer Merten van Gerven
Extension Mage_Laposta_Connect
Version 1.0.14
Comparing to
See all releases


Code changes from version 1.0.13 to 1.0.14

app/code/community/Laposta/Connect/Model/Observer.php CHANGED
@@ -75,7 +75,6 @@ class Laposta_Connect_Model_Observer
75
 
76
  /** @var $collection Laposta_Connect_Model_Mysql4_Subscriber_Collection */
77
  $collection = Mage::getModel('lapostaconnect/subscriber')->getCollection();
78
- $customerId = $nativeSubscriber->getCustomerId();
79
 
80
  /*
81
  * find laposta subscriber by subscriber id
@@ -83,27 +82,32 @@ class Laposta_Connect_Model_Observer
83
 
84
  /** @var $subscriber Laposta_Connect_Model_Subscriber */
85
  $subscriber = $collection->getItemByColumnValue('newsletter_subscriber_id', $nativeSubscriber->getId());
 
86
 
87
- /*
88
- * if not found and customer id is not '0' it could be a legacy record
89
- */
90
-
91
- if ($customerId != "0" && (!$subscriber instanceof Laposta_Connect_Model_Subscriber || $subscriber->isEmpty())) {
 
 
 
 
 
92
  $subscriber = $collection->getItemByColumnValue('customer_id', $customerId);
 
93
 
 
94
  /*
95
- * update entries stored without a newsletter_subscriber_id
96
  */
97
-
98
  $subscriber->setNewsletterSubscriberId($nativeSubscriber->getId());
99
  $subscriber->save();
100
  }
101
-
102
- /*
103
- * if subscriber still doesn't exist then it really doesn't exist yet.
104
- */
105
-
106
- if (!$subscriber instanceof Laposta_Connect_Model_Subscriber || $subscriber->isEmpty()) {
107
  /** @var $lists Laposta_Connect_Model_Mysql4_List_Collection */
108
  $lists = Mage::getModel('lapostaconnect/list')->getCollection();
109
  /** @var $list Laposta_Connect_Model_List */
75
 
76
  /** @var $collection Laposta_Connect_Model_Mysql4_Subscriber_Collection */
77
  $collection = Mage::getModel('lapostaconnect/subscriber')->getCollection();
 
78
 
79
  /*
80
  * find laposta subscriber by subscriber id
82
 
83
  /** @var $subscriber Laposta_Connect_Model_Subscriber */
84
  $subscriber = $collection->getItemByColumnValue('newsletter_subscriber_id', $nativeSubscriber->getId());
85
+ $customerId = $nativeSubscriber->getCustomerId();
86
 
87
+ if ($subscriber instanceof Laposta_Connect_Model_Subscriber && !$subscriber->isEmpty()) {
88
+ /*
89
+ * Subscriber already exists. No need to continue.
90
+ */
91
+ return;
92
+ }
93
+ else if ($customerId != "0") {
94
+ /*
95
+ * if not found and customer id is not '0' it could be a legacy record
96
+ */
97
  $subscriber = $collection->getItemByColumnValue('customer_id', $customerId);
98
+ }
99
 
100
+ if ($subscriber instanceof Laposta_Connect_Model_Subscriber && !$subscriber->isEmpty()) {
101
  /*
102
+ * If subscriber is found then update the newsletter subscriber id
103
  */
 
104
  $subscriber->setNewsletterSubscriberId($nativeSubscriber->getId());
105
  $subscriber->save();
106
  }
107
+ else {
108
+ /*
109
+ * if subscriber still doesn't exist then it really doesn't exist yet.
110
+ */
 
 
111
  /** @var $lists Laposta_Connect_Model_Mysql4_List_Collection */
112
  $lists = Mage::getModel('lapostaconnect/list')->getCollection();
113
  /** @var $list Laposta_Connect_Model_List */
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_Laposta_Connect</name>
4
- <version>1.0.13</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -16,20 +16,20 @@
16
  &lt;h2&gt;Installation&lt;/h2&gt;&#xD;
17
  &lt;p&gt;This extension is installable via the Magento Connect Manager.&lt;/p&gt;&#xD;
18
  &lt;p&gt;Please follow the instruction provided by Magento for installing and maintaing extensions.&lt;/p&gt;&#xD;
19
- &lt;p&gt;&lt;strong&gt;Remember:&lt;/strong&gt; Once you have installed the plugin please log out of the admin panel and log in again. You may also need to clear Magento's storage cache (System &gt; Cache Management) before the plugin becomes available for configuration and usage.&lt;/p&gt;&#xD;
20
  &#xD;
21
  &lt;h2&gt;Configuration and Usage&lt;/h2&gt;&#xD;
22
- &lt;p&gt;To configure your extension and start the synchronization process please go to System &gt; Configuration. In the left menu you should have a Laposta section with a Laposta Configuration link.&lt;/p&gt;&#xD;
23
  &lt;p&gt;Aside from providiing your Laposta API key this extension will work out of the box though we encourage you to provide a Laposta List Name of your choosing to be able to identify your mailing list within Laposta.&lt;/p&gt;&#xD;
24
  &#xD;
25
  &lt;h2&gt;Questions&lt;/h2&gt;&#xD;
26
  &lt;p&gt;Please see the FAQ section for questions.&lt;/p&gt;</description>
27
- <notes>- Added missing event declarations from admin&#xD;
28
- </notes>
29
  <authors><author><name>Merten van Gerven</name><user>mertenvg</user><email>merten@codeblanche.com</email></author></authors>
30
- <date>2014-09-25</date>
31
- <time>15:56:28</time>
32
- <contents><target name="magecommunity"><dir name="Laposta"><dir name="Connect"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Mapfields.php" hash="2c88b8a08121c09ba5748f631205a282"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Customer.php" hash="ef0a5dff85fd77de92a0fefe06fddc60"/><file name="Data.php" hash="8f9e28d0f28f9375385432d227ec1d06"/><file name="Fields.php" hash="51bc0aa26167219b038c04b3babb19af"/><file name="Laposta.php" hash="f763f69df1ecc0ace15706bf5b2581b5"/><file name="Subscribe.php" hash="55f128263acb89cd1d9ab7f36e0dec07"/><file name="Sync.php" hash="97dc4aa48a3b0712274a8bbaad80a6c6"/></dir><dir name="Model"><file name="Cron.php" hash="270a2289a1de1bc678dfc4e6264c095b"/><file name="Field.php" hash="42e1857bdb7d90b31be189e2921ac8fd"/><file name="List.php" hash="99f590a5e5ea3b1a14869c641f49eaed"/><dir name="Mysql4"><dir name="Field"><file name="Collection.php" hash="f8133202231937b1ec14d8cdc39903fe"/></dir><file name="Field.php" hash="c49743d6acd1d4ce2b69aadf22838839"/><dir name="List"><file name="Collection.php" hash="fcc556452fff91bb3e9f933c68fff630"/></dir><file name="List.php" hash="6fef1b36f5d3a5560f83bafe205be614"/><dir name="Subscriber"><file name="Collection.php" hash="05db928eb656f132e4fa16ac740ce3c5"/></dir><file name="Subscriber.php" hash="9f73d39e97d4a19f8d8ad3c19f83a699"/></dir><file name="Observer.php" hash="fc3f7b870742256be4dca3110e77205e"/><file name="Subscriber.php" hash="cba5176e53a7dcab9b9014190f13485d"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="LapostaController.php" hash="cc2a0d62caf63469258042e3b29616e4"/></dir><file name="IndexController.php" hash="7577e30abee9624d59901edb5cecd3e9"/><file name="SubscribeAllController.php" hash="160ac8e5229bb1003d7220116a9b06f7"/><file name="WebhookController.php" hash="0526b02b319fc31cd8c8a3e9789ba358"/></dir><dir name="etc"><file name="adminhtml.xml" hash="71f985837d4b79e3db94c529bfee1e47"/><file name="config.xml" hash="72458847e9370acc79614139a38d502d"/><file name="system.xml" hash="6ee7d5de56541573f16a2caf94dc0418"/></dir><dir name="lib"><dir name="Laposta"><dir name="Laposta"><file name="Error.php" hash="46e746b650bbb5df1ec51f4c530d5f35"/><file name="Field.php" hash="99bc22f997692ff648cb660330552a94"/><file name="List.php" hash="f3b8a716c1d9fd11828f980445dd6d5b"/><file name="Login.php" hash="dc11941e5ca3a404005730843c74e8b3"/><file name="Member.php" hash="cae2b3f6b23ee44e9246a8d33d2ddd46"/><file name="Request.php" hash="66bc536b8b9ce443c3ae0917bdd472ed"/><file name="Resource.php" hash="c2ca77821136b798b526b5dc41659054"/><file name="Util.php" hash="d6760d2d5ddb6f4de6aff185fd432a91"/><file name="Webhook.php" hash="e06b2e711c348af1df425b7faaa5c33e"/></dir><file name="Laposta.php" hash="c99f38dcfef24df38a5a921360356381"/></dir></dir><dir name="sql"><dir name="lapostaconnect_setup"><file name="mysql4-install-1.0.0.php" hash="a1b0319b992b9effe6aa2712031e8701"/><file name="mysql4-install-1.0.12.php" hash="aafda6f1342a9e5ca30c3a87886619f8"/><file name="mysql4-upgrade-1.0.11-1.0.12.php" hash="4cb4083f5bbc27dc719bd0a816a33476"/><file name="mysql4-upgrade-1.0.7-1.0.8.php" hash="a1b0319b992b9effe6aa2712031e8701"/></dir></dir></dir></dir></target><target name="magelocal"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="lapostaconnect.xml" hash=""/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Laposta_Connect.xml" hash="ab7675e19ea96d39c5980bee835f0e76"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Laposta_Connect.csv" hash="4f8f28790602cdd01633c0bb00f70585"/></dir></target></contents>
33
  <compatible/>
34
- <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
35
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_Laposta_Connect</name>
4
+ <version>1.0.14</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
16
  &lt;h2&gt;Installation&lt;/h2&gt;&#xD;
17
  &lt;p&gt;This extension is installable via the Magento Connect Manager.&lt;/p&gt;&#xD;
18
  &lt;p&gt;Please follow the instruction provided by Magento for installing and maintaing extensions.&lt;/p&gt;&#xD;
19
+ &lt;p&gt;&lt;strong&gt;Remember:&lt;/strong&gt; Once you have installed the plugin please log out of the admin panel and log in again. You may also need to clear Magento's storage cache (System &amp;gt; Cache Management) before the plugin becomes available for configuration and usage.&lt;/p&gt;&#xD;
20
  &#xD;
21
  &lt;h2&gt;Configuration and Usage&lt;/h2&gt;&#xD;
22
+ &lt;p&gt;To configure your extension and start the synchronization process please go to System &amp;gt; Configuration. In the left menu you should have a Laposta section with a Laposta Configuration link.&lt;/p&gt;&#xD;
23
  &lt;p&gt;Aside from providiing your Laposta API key this extension will work out of the box though we encourage you to provide a Laposta List Name of your choosing to be able to identify your mailing list within Laposta.&lt;/p&gt;&#xD;
24
  &#xD;
25
  &lt;h2&gt;Questions&lt;/h2&gt;&#xD;
26
  &lt;p&gt;Please see the FAQ section for questions.&lt;/p&gt;</description>
27
+ <notes>- Fixed bug with subscription observer in Magento CE 1.9.1.1&#xD;
28
+ - Tested for compatibility with Magento CE 1.9.1.1</notes>
29
  <authors><author><name>Merten van Gerven</name><user>mertenvg</user><email>merten@codeblanche.com</email></author></authors>
30
+ <date>2015-09-02</date>
31
+ <time>04:25:52</time>
32
+ <contents><target name="magecommunity"><dir name="Laposta"><dir name="Connect"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Mapfields.php" hash="2c88b8a08121c09ba5748f631205a282"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Customer.php" hash="ef0a5dff85fd77de92a0fefe06fddc60"/><file name="Data.php" hash="8f9e28d0f28f9375385432d227ec1d06"/><file name="Fields.php" hash="51bc0aa26167219b038c04b3babb19af"/><file name="Laposta.php" hash="f763f69df1ecc0ace15706bf5b2581b5"/><file name="Subscribe.php" hash="55f128263acb89cd1d9ab7f36e0dec07"/><file name="Sync.php" hash="97dc4aa48a3b0712274a8bbaad80a6c6"/></dir><dir name="Model"><file name="Cron.php" hash="270a2289a1de1bc678dfc4e6264c095b"/><file name="Field.php" hash="42e1857bdb7d90b31be189e2921ac8fd"/><file name="List.php" hash="99f590a5e5ea3b1a14869c641f49eaed"/><dir name="Mysql4"><dir name="Field"><file name="Collection.php" hash="f8133202231937b1ec14d8cdc39903fe"/></dir><file name="Field.php" hash="c49743d6acd1d4ce2b69aadf22838839"/><dir name="List"><file name="Collection.php" hash="fcc556452fff91bb3e9f933c68fff630"/></dir><file name="List.php" hash="6fef1b36f5d3a5560f83bafe205be614"/><dir name="Subscriber"><file name="Collection.php" hash="05db928eb656f132e4fa16ac740ce3c5"/></dir><file name="Subscriber.php" hash="9f73d39e97d4a19f8d8ad3c19f83a699"/></dir><file name="Observer.php" hash="37b4b7ac5e6914e8c1d1d480dfc986b7"/><file name="Subscriber.php" hash="cba5176e53a7dcab9b9014190f13485d"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="LapostaController.php" hash="cc2a0d62caf63469258042e3b29616e4"/></dir><file name="IndexController.php" hash="7577e30abee9624d59901edb5cecd3e9"/><file name="SubscribeAllController.php" hash="160ac8e5229bb1003d7220116a9b06f7"/><file name="WebhookController.php" hash="0526b02b319fc31cd8c8a3e9789ba358"/></dir><dir name="etc"><file name="adminhtml.xml" hash="71f985837d4b79e3db94c529bfee1e47"/><file name="config.xml" hash="72458847e9370acc79614139a38d502d"/><file name="system.xml" hash="6ee7d5de56541573f16a2caf94dc0418"/></dir><dir name="lib"><dir name="Laposta"><dir name="Laposta"><file name="Error.php" hash="46e746b650bbb5df1ec51f4c530d5f35"/><file name="Field.php" hash="99bc22f997692ff648cb660330552a94"/><file name="List.php" hash="f3b8a716c1d9fd11828f980445dd6d5b"/><file name="Login.php" hash="dc11941e5ca3a404005730843c74e8b3"/><file name="Member.php" hash="cae2b3f6b23ee44e9246a8d33d2ddd46"/><file name="Request.php" hash="66bc536b8b9ce443c3ae0917bdd472ed"/><file name="Resource.php" hash="c2ca77821136b798b526b5dc41659054"/><file name="Util.php" hash="d6760d2d5ddb6f4de6aff185fd432a91"/><file name="Webhook.php" hash="e06b2e711c348af1df425b7faaa5c33e"/></dir><file name="Laposta.php" hash="c99f38dcfef24df38a5a921360356381"/></dir></dir><dir name="sql"><dir name="lapostaconnect_setup"><file name="mysql4-install-1.0.0.php" hash="a1b0319b992b9effe6aa2712031e8701"/><file name="mysql4-install-1.0.12.php" hash="aafda6f1342a9e5ca30c3a87886619f8"/><file name="mysql4-upgrade-1.0.11-1.0.12.php" hash="4cb4083f5bbc27dc719bd0a816a33476"/><file name="mysql4-upgrade-1.0.7-1.0.8.php" hash="a1b0319b992b9effe6aa2712031e8701"/></dir></dir></dir></dir></target><target name="magelocal"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="lapostaconnect.xml" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Laposta_Connect.csv" hash="4f8f28790602cdd01633c0bb00f70585"/></dir></target><target name="mageetc"><dir name="modules"><file name="Laposta_Connect.xml" hash="ab7675e19ea96d39c5980bee835f0e76"/></dir></target></contents>
33
  <compatible/>
34
+ <dependencies><required><php><min>5.3.0</min><max>5.5.9</max></php></required></dependencies>
35
  </package>