Skip to content
This repository has been archived by the owner on Jul 25, 2020. It is now read-only.

Commit

Permalink
Version v2.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitridr committed Dec 16, 2017
1 parent 448675c commit 28fe677
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
*** Facebook Ads Extension For Magento Changelog ***

2017-12-14 version 2.3.6
- Blank Screen Fix : Detect case where currency conversion rate is undefined.
- Include ACL Permissions (Thanks @WaPoNe!)

2017-12-07 version 2.3.5
- Fix memory leak.
- New method of loading store specific products.
Expand Down
24 changes: 22 additions & 2 deletions app/code/community/Facebook/AdsExtension/Model/FBProductFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,6 @@ private function writeProducts($io, $total_number_of_products, $should_log) {
} else {
$skip_count++;
}
$product->clearInstance();
} catch (\Exception $e) {
$exception_count++;
// Don't overload the logs, log the first 3 exceptions.
Expand All @@ -450,6 +449,7 @@ private function writeProducts($io, $total_number_of_products, $should_log) {
throw $e;
}
}
$product->clearInstance();
}
unset($products);
$count += $batch_max;
Expand Down Expand Up @@ -666,9 +666,29 @@ private function getProductPrice($product) {
if (!isset($this->current_currency)) {
$this->current_currency = Mage::app()->getStore($this->store_id)->getCurrentCurrencyCode();
}

if ($this->base_currency === $this->current_currency) {
return $price;
}

if (!isset($this->currency_rate)) {
$this->currency_rate =
Mage::getModel('directory/currency')->getCurrencyRates(
$this->base_currency, array($this->current_currency)
);
$this->currency_rate =
is_array($this->currency_rate) ? end($this->currency_rate) : 0;
}

if (!$this->currency_rate || is_nan($this->currency_rate)) {
self::log("ERROR : Currency Conversion Rate Is 0/Infinity.");
throw new Exception(
"ERROR : Currency Conversion Rate Is 0/Infinity.\n".
"Failed when converting ".$this->base_currency." to ".$this->current_currency.
" getCurrencyRate() returned ".($this->currency_rate ?: " NULL")."\n".
" This can be fixed by setting your currency rates in ".
"System > Currency > Rates"
);
} else {
return Mage::helper('directory')->currencyConvert(
$price,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Facebook_AdsExtension_Adminhtml_FbmainController
protected function _isAllowed() {
return Mage::getSingleton('admin/session')->isAllowed('facebook_ads_extension');
}

public function indexAction() {
$this->loadLayout();
$this->_setActiveMenu('facebook_ads_extension');
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Facebook/AdsExtension/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<Facebook_AdsExtension>
<version>2.3.5</version>
<version>2.3.6</version>
</Facebook_AdsExtension>
</modules>
<global>
Expand Down
3 changes: 2 additions & 1 deletion js/Facebook/AdsExtension/Adminhtml/fae.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ var FAEFlowContainer = React.createClass({
{className: 'fae-flow-container', style: {color: 'red'}},
React.createElement('div', null),
'Fatal exception when loading configuration. Please send the trace below ' +
'to the Developers by using the provided button. ',
'to the Developers by using the provided button. Then open a new issue on our github ',
React.createElement('a', {href: 'https://github.com/facebookincubator/facebook-for-magento/issues'}, ' here.'),
React.createElement('div', null),
React.createElement(
'button',
Expand Down

0 comments on commit 28fe677

Please sign in to comment.