Version Notes
It's simple and done
Download this release
Release Info
Developer | Greg Croasdill |
Extension | SubscriptionFix |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
app/code/community/HE/SubscribeFix/HE_SubscribeFix.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<HE_SubscribeFix>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</HE_SubscribeFix>
|
8 |
+
</modules>
|
9 |
+
</config>
|
app/code/community/HE/SubscribeFix/Model/Observer.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by JetBrains PhpStorm.
|
4 |
+
* User: gregc
|
5 |
+
* Date: 8/23/13
|
6 |
+
* Time: 3:05 PM
|
7 |
+
*/
|
8 |
+
|
9 |
+
|
10 |
+
class HE_SubscribeFix_Model_Observer
|
11 |
+
{
|
12 |
+
|
13 |
+
/**
|
14 |
+
* @param Varien_Event_Observer $observer
|
15 |
+
*
|
16 |
+
* observer function to update the subscription action date
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
|
20 |
+
public function setUpdateDate(Varien_Event_Observer $observer) {
|
21 |
+
$subscriber = $observer->getSubscriber();
|
22 |
+
$subscriber['change_status_at'] = (date("Y-m-d H:i:s", time()));
|
23 |
+
}
|
24 |
+
}
|
app/code/community/HE/SubscribeFix/etc/config.xml
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<HE_SubscribeFix>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</HE_SubscribeFix>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<models>
|
10 |
+
<subscribefix>
|
11 |
+
<class>HE_SubscribeFix_Model</class>
|
12 |
+
</subscribefix>
|
13 |
+
</models>
|
14 |
+
|
15 |
+
<events>
|
16 |
+
<newsletter_subscriber_save_before>
|
17 |
+
<observers>
|
18 |
+
<subscribefix_observer_subscriber>
|
19 |
+
<type>singleton</type>
|
20 |
+
<class>HE_SubscribeFix_Model_Observer</class>
|
21 |
+
<method>setUpdateDate</method>
|
22 |
+
</subscribefix_observer_subscriber>
|
23 |
+
</observers>
|
24 |
+
</newsletter_subscriber_save_before>
|
25 |
+
</events>
|
26 |
+
|
27 |
+
</global>
|
28 |
+
</config>
|
app/etc/modules/HE_SubscribeFix.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<HE_SubscribeFix>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</HE_SubscribeFix>
|
8 |
+
</modules>
|
9 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>SubscriptionFix</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>OSL</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Magento no longer updates the date associated with newsletter subscribe/unsubscribe actions. This simple observer inserts the current date and time into the change_status_at field</summary>
|
10 |
+
<description>A customer wanted to know the dates that subscribe/unsubscribe actions were occurring.
|
11 |
+

|
12 |
+
Viewing the newsletter_subscriber table in the magento database, it looks like the date is supposed to be stored, but the field value is always NIL.
|
13 |
+

|
14 |
+
Looking around the internets I've found a few others who have run into this and some claim that it used to work in very old version of Magento, but doesn't anymore.
|
15 |
+

|
16 |
+
At a guess, I think what happened is that the field definition for change_status_at used to be setup to auto update as a default timestamp (i.e. ON UPDATE CURRENT_TIMESTAMP), but that was lost in some update. So there's no Magento code that writes to the field, because MySql is supposed to magically maintain it.</description>
|
17 |
+
<notes>It's simple and done</notes>
|
18 |
+
<authors><author><name>Greg Croasdill</name><user>groggu</user><email>gregc@human-element.com</email></author></authors>
|
19 |
+
<date>2013-08-23</date>
|
20 |
+
<time>20:32:55</time>
|
21 |
+
<contents><target name="magecommunity"><dir name="HE"><dir name="SubscribeFix"><file name="HE_SubscribeFix.xml" hash="2f6ab9c6d61db4544fdbac6948d9377b"/><dir name="Model"><file name="Observer.php" hash="4d02876674ba4dddf92d4db1e76f0bed"/></dir><dir name="etc"><file name="config.xml" hash="a73168ccf135375ef1aad803d4928125"/></dir><dir name=".git"><file name="HEAD" hash="4cf2d64e44205fe628ddd534e1151b58"/><file name="config" hash="182acc0017122b81d417bf6d6c0c98ce"/><file name="description" hash="a0a7c3fff21f2aea3cfa1d0316dd816c"/><dir name="hooks"><file name="applypatch-msg.sample" hash="9cc72dc973e24f9623bd3fe708f60ef5"/><file name="commit-msg.sample" hash="579a3c1e12a1e74a98169175fb913012"/><file name="post-commit.sample" hash="61ccc7ddbd92e1ae5a978a5709db2630"/><file name="post-receive.sample" hash="5df473ab47ebecdf0c85f5f828f42991"/><file name="post-update.sample" hash="2b7ea5cee3c49ff53d41e00785eb974c"/><file name="pre-applypatch.sample" hash="a4a7e457b55b5ac2877f7973dbba37e9"/><file name="pre-commit.sample" hash="15449d98cfa79704332d057b3f91093c"/><file name="pre-rebase.sample" hash="81005745454846bb79cc3c7c0c57658d"/><file name="prepare-commit-msg.sample" hash="7dfe15854212a30f346da5255c1d794b"/><file name="update.sample" hash="98d7f8e291edbab8df79e433dc97ecc8"/></dir><file name="index" hash="75c879800a16aad5787adbfc7e67e304"/><dir name="info"><file name="exclude" hash="036208b4a1ab4a235d75c181e685e5a3"/></dir><dir name="objects"><dir name="2f"><file name="b96146a426f2fa9bffa19019e096b8c0db69ee" hash="44a22a55d2f7bfc8589163d2abf621f1"/></dir><dir name="5b"><file name="69fa52848614a844247433fa6136fcb832081e" hash="193adc350c5503d4c1b7278dbcfc2f21"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="HE_SubscribeFix.xml" hash="c481293cc6c9cfcc972fdf4212f516d2"/></dir></target></contents>
|
22 |
+
<compatible/>
|
23 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
24 |
+
</package>
|