Version Notes
- Fix 'Connection Failed' issues for some stores.
- Fix 'Mage registry key already exists' issues.
- Fix caching issues preventing feed generation.
Download this release
Release Info
Developer | Jordan Rogers-Smith |
Extension | Facebook_Ads_Toolbox |
Version | 2.1.3 |
Comparing to | |
See all releases |
Code changes from version 2.1.2 to 2.1.3
- app/code/community/Facebook/AdsToolbox/Model/FacebookProductFeed.php +13 -0
- app/code/community/Facebook/AdsToolbox/Model/Observer.php +1 -8
- app/code/community/Facebook/AdsToolbox/controllers/ProductfeedController.php +0 -1
- app/code/community/Facebook/AdsToolbox/etc/config.xml +1 -1
- package.xml +5 -4
app/code/community/Facebook/AdsToolbox/Model/FacebookProductFeed.php
CHANGED
@@ -109,6 +109,8 @@ class FacebookProductFeed {
|
|
109 |
if (strlen($attr_value) > 5000) {
|
110 |
$attr_value = substr($attr_value, 0, 5000);
|
111 |
}
|
|
|
|
|
112 |
return $escapefn ? $this->$escapefn($attr_value) : $attr_value;
|
113 |
}
|
114 |
break;
|
@@ -385,4 +387,15 @@ class FacebookProductFeed {
|
|
385 |
return self::fileIsStale($file_path);
|
386 |
}
|
387 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
388 |
}
|
109 |
if (strlen($attr_value) > 5000) {
|
110 |
$attr_value = substr($attr_value, 0, 5000);
|
111 |
}
|
112 |
+
// description can't be all uppercase
|
113 |
+
//$attr_value = $this->uppercaseFirstOnlyIfAllCaps($attr_value);
|
114 |
return $escapefn ? $this->$escapefn($attr_value) : $attr_value;
|
115 |
}
|
116 |
break;
|
387 |
return self::fileIsStale($file_path);
|
388 |
}
|
389 |
|
390 |
+
private function uppercaseFirstOnlyIfAllCaps($string) {
|
391 |
+
// if contains non-western characters, it can't be all uppercase
|
392 |
+
if (!preg_match('/[^\\p{Common}\\p{Latin}]/u', $string)) {
|
393 |
+
$latin_string = preg_replace('/[^\\p{Latin}]/u', '', $string);
|
394 |
+
if ($latin_string !== '' &&
|
395 |
+
mb_strtoupper($latin_string, 'utf-8') === $latin_string) {
|
396 |
+
return ucwords(strtolower($string));
|
397 |
+
}
|
398 |
+
}
|
399 |
+
return $string;
|
400 |
+
}
|
401 |
}
|
app/code/community/Facebook/AdsToolbox/Model/Observer.php
CHANGED
@@ -104,13 +104,6 @@ class Facebook_AdsToolbox_Model_Observer {
|
|
104 |
// no_lock & stale feed, or stale_lock, we will regen the feed
|
105 |
}
|
106 |
|
107 |
-
if (!Mage::getStoreConfigFlag(
|
108 |
-
FacebookProductFeed::PATH_FACEBOOK_ADSTOOLBOX_FEED_GENERATION_ENABLED
|
109 |
-
)) {
|
110 |
-
FacebookProductFeed::log('feed generation not enabled.');
|
111 |
-
return;
|
112 |
-
}
|
113 |
-
|
114 |
try {
|
115 |
$this->_createFileLockForFeedPath($feed_target_file_path);
|
116 |
$feed->save();
|
@@ -163,7 +156,7 @@ class Facebook_AdsToolbox_Model_Observer {
|
|
163 |
$observer->getEvent()->getControllerAction()->getFullActionName();
|
164 |
|
165 |
// Clear cache for FB controllers.
|
166 |
-
if (strpos($controller_name, '
|
167 |
Mage::app()->getCacheInstance()->cleanType('config');
|
168 |
}
|
169 |
}
|
104 |
// no_lock & stale feed, or stale_lock, we will regen the feed
|
105 |
}
|
106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
try {
|
108 |
$this->_createFileLockForFeedPath($feed_target_file_path);
|
109 |
$feed->save();
|
156 |
$observer->getEvent()->getControllerAction()->getFullActionName();
|
157 |
|
158 |
// Clear cache for FB controllers.
|
159 |
+
if (strpos($controller_name, 'adminhtml_fb') !== false) {
|
160 |
Mage::app()->getCacheInstance()->cleanType('config');
|
161 |
}
|
162 |
}
|
app/code/community/Facebook/AdsToolbox/controllers/ProductfeedController.php
CHANGED
@@ -11,7 +11,6 @@
|
|
11 |
require_once 'app/Mage.php';
|
12 |
require_once __DIR__.'/../lib/fb.php';
|
13 |
|
14 |
-
// DEPRECATED : Kept around for legacy reasons.
|
15 |
class Facebook_AdsToolbox_ProductfeedController
|
16 |
extends Mage_Core_Controller_Front_Action {
|
17 |
|
11 |
require_once 'app/Mage.php';
|
12 |
require_once __DIR__.'/../lib/fb.php';
|
13 |
|
|
|
14 |
class Facebook_AdsToolbox_ProductfeedController
|
15 |
extends Mage_Core_Controller_Front_Action {
|
16 |
|
app/code/community/Facebook/AdsToolbox/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Facebook_AdsToolbox>
|
5 |
-
<version>2.1.
|
6 |
</Facebook_AdsToolbox>
|
7 |
</modules>
|
8 |
<global>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Facebook_AdsToolbox>
|
5 |
+
<version>2.1.3</version>
|
6 |
</Facebook_AdsToolbox>
|
7 |
</modules>
|
8 |
<global>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Facebook_Ads_Toolbox</name>
|
4 |
-
<version>2.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="https://raw.githubusercontent.com/fbsamples/audience-network-support/master/LICENSE">Facebook License</license>
|
7 |
<channel>community</channel>
|
@@ -60,11 +60,12 @@ _Installation Instructions_
|
|
60 |
Additional FAQ
|
61 |
https://www.facebook.com/help/532749253576163</description>
|
62 |
<notes>- Fix 'Connection Failed' issues for some stores.
|
63 |
-
- Fix 'Mage registry key already exists' issues
|
|
|
64 |
<authors><author><name>Jordan Rogers-Smith</name><user>jordanrs</user><email>jordanrs@fb.com</email></author><author><name>Yu Li</name><user>liyuhk</user><email>liyuhk@fb.com</email></author><author><name>Dmitri Dranishnikov</name><user>dmitrid</user><email>dmitrid@fb.com</email></author></authors>
|
65 |
<date>2016-09-30</date>
|
66 |
-
<time>
|
67 |
-
<contents><target name="magecommunity"><dir name="Facebook"><dir name="AdsToolbox"><dir><dir name="Block"><file name="AddToCart.php" hash="0bb7985b9079b8e70585aea350dc1524"/><dir name="Adminhtml"><file name="Diaindex.php" hash="fcb051385a285bb7268935d0b4d4aa49"/><file name="Feedindex.php" hash="f08548f1c321e70fb4bebdf5fa6acc37"/><file name="Pixelindex.php" hash="270546423b83541e003e1336d7f3a6ce"/></dir><file name="Head.php" hash="eb5ee970cfb6873b9def860232089460"/><file name="InitiateCheckout.php" hash="c47ed5209bed0ae4dbad120be1ba13b3"/><file name="Purchase.php" hash="0c65646369b87e6c818da4f3fdc0e155"/><file name="Search.php" hash="d8acaa72da8ca3df2146949276a3714d"/><file name="ViewCategory.php" hash="36e19e8ff10acbc862420ac8dc39fd05"/><file name="ViewContent.php" hash="38ced65dd84888045e3ef9f189124d0a"/><file name="common.php" hash="ed0e2a1dc8c84138dc6c728b2d428054"/></dir><dir name="Helper"><file name="Data.php" hash="09da04dbb30d6de8b7a873f0447456ba"/></dir><dir name="Model"><file name="FacebookProductFeed.php" hash="
|
68 |
<compatible/>
|
69 |
<dependencies><required><php><min>5.3.0</min><max>8.0.0</max></php></required></dependencies>
|
70 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Facebook_Ads_Toolbox</name>
|
4 |
+
<version>2.1.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="https://raw.githubusercontent.com/fbsamples/audience-network-support/master/LICENSE">Facebook License</license>
|
7 |
<channel>community</channel>
|
60 |
Additional FAQ
|
61 |
https://www.facebook.com/help/532749253576163</description>
|
62 |
<notes>- Fix 'Connection Failed' issues for some stores.
|
63 |
+
- Fix 'Mage registry key already exists' issues.
|
64 |
+
- Fix caching issues preventing feed generation.</notes>
|
65 |
<authors><author><name>Jordan Rogers-Smith</name><user>jordanrs</user><email>jordanrs@fb.com</email></author><author><name>Yu Li</name><user>liyuhk</user><email>liyuhk@fb.com</email></author><author><name>Dmitri Dranishnikov</name><user>dmitrid</user><email>dmitrid@fb.com</email></author></authors>
|
66 |
<date>2016-09-30</date>
|
67 |
+
<time>20:57:30</time>
|
68 |
+
<contents><target name="magecommunity"><dir name="Facebook"><dir name="AdsToolbox"><dir><dir name="Block"><file name="AddToCart.php" hash="0bb7985b9079b8e70585aea350dc1524"/><dir name="Adminhtml"><file name="Diaindex.php" hash="fcb051385a285bb7268935d0b4d4aa49"/><file name="Feedindex.php" hash="f08548f1c321e70fb4bebdf5fa6acc37"/><file name="Pixelindex.php" hash="270546423b83541e003e1336d7f3a6ce"/></dir><file name="Head.php" hash="eb5ee970cfb6873b9def860232089460"/><file name="InitiateCheckout.php" hash="c47ed5209bed0ae4dbad120be1ba13b3"/><file name="Purchase.php" hash="0c65646369b87e6c818da4f3fdc0e155"/><file name="Search.php" hash="d8acaa72da8ca3df2146949276a3714d"/><file name="ViewCategory.php" hash="36e19e8ff10acbc862420ac8dc39fd05"/><file name="ViewContent.php" hash="38ced65dd84888045e3ef9f189124d0a"/><file name="common.php" hash="ed0e2a1dc8c84138dc6c728b2d428054"/></dir><dir name="Helper"><file name="Data.php" hash="09da04dbb30d6de8b7a873f0447456ba"/></dir><dir name="Model"><file name="FacebookProductFeed.php" hash="e21a88d6d32515533f562527299d534f"/><file name="FacebookProductFeedSamples.php" hash="dd521346db85be6268605dce574d70c1"/><file name="FacebookProductFeedTSV.php" hash="574e25925a8ffd023b575c239d552a3b"/><file name="FacebookProductFeedXML.php" hash="f62f7630ffd1f34b5a062855da62865f"/><file name="Observer.php" hash="6ba9ee34820ad5b86480fba72a540310"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="FbfeedController.php" hash="a55045c8ad914584490d36f1410b0051"/><file name="FbfeedlogController.php" hash="34938878c691842a71f4f788c0b5cfee"/><file name="FbmainController.php" hash="b952bf87ca7b49a2b1fb256025e39331"/><file name="FbpixelController.php" hash="f00c250878671e6e4957239ddd952476"/><file name="FbregenController.php" hash="1837e42c7e6d4d9c77bb386732d08e28"/></dir><file name="DebugController.php" hash="cf3aa8f25e7c4301de9f5f908fca40e5"/><file name="ProductfeedController.php" hash="c9aedcb0b2d7d3ee66272fea143e8fd2"/></dir><dir name="etc"><file name="adminhtml.xml" hash="be7e9a1dfc20ca73654c8e4ac557e4c9"/><file name="config.xml" hash="1d91817b7a3248aa997283c7274644e0"/></dir><dir name="lib"><file name="fb.php" hash="00034f813eb9c1679232ec5e0e7b9d22"/></dir></dir><file name="LICENSE" hash="4e3837b373e2371aeb3317bc8d245ad6"/><file name="PATENTS" hash="7eb20d51ce76c08c2e6c939674e75c93"/></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="facebookadstoolbox.xml" hash="cd8d60f293f5d1b5925efe01c7e48af7"/></dir><dir name="template"><dir name="facebookadstoolbox"><file name="addtocart.phtml" hash="cffaf57c6b633e1c5641783f08769726"/><file name="head.phtml" hash="217c676e9f1893f17073904a62796016"/><file name="initiate_checkout.phtml" hash="0f57840eef0477538b211d63d6c6d3b5"/><file name="purchase.phtml" hash="278c3819865a6a8ef3c03cb1189e4a4c"/><file name="search.phtml" hash="a67005ea51ae63b225cb598cf9152014"/><file name="viewcategory.phtml" hash="c56f37ab17654b53ace6180903900cf3"/><file name="viewcontent.phtml" hash="ebf7844a601511d85135cfaf623a9bc1"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="facebookadstoolbox.xml" hash="5974bb612e16c7b7eff07ef06eddebda"/></dir><dir name="template"><dir name="facebookadstoolbox"><file name="dia_index.phtml" hash="a76da427d9f704ae7af6924633e3b2e4"/><file name="feed_index.phtml" hash="157e56ef40e56378bcd07284162fb439"/><file name="pixel_index.phtml" hash="0b8e1171703bfb27ce5c768c6e79dc81"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="Facebook"><dir name="AdsToolbox"><dir><dir name="Adminhtml"><file name="dia.js" hash="eee4506b93da5703034f2b9f405d82b3"/><file name="feed.js" hash="134fbbb334e0d2422b77435dc105ebf5"/><dir name="lib"><file name="react-dom.min.js" hash="80dd76fff4872e658666dec43913360c"/><file name="react.min.js" hash="c3207f7bf39699d4279ba404ea55f163"/></dir><file name="pixel.js" hash="916afd85272d48e3b34c8f2a9f4db38a"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Facebook_AdsToolbox.xml" hash="164bc795b6911c5b0a6ca357a56f38cc"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="Facebook"><dir name="AdsToolbox"><dir><dir name="css"><dir name="Adminhtml"><file name="dia.css" hash="201b2a78305d44d6eeebbf67231e7767"/><file name="feed.css" hash="2763caa9c8f3b9b21f85a59915d39157"/><file name="pixel.css" hash="8b143487fcc4a902c0e44de8e2af6eef"/></dir></dir><dir name="images"><dir name="Adminhtml"><file name="buttonbg.png" hash="09adbacda0d592a215277230c48df285"/><file name="fbicons.png" hash="8f1b559a279a3785f1b2492a79f518d8"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
|
69 |
<compatible/>
|
70 |
<dependencies><required><php><min>5.3.0</min><max>8.0.0</max></php></required></dependencies>
|
71 |
</package>
|