Skip to content
This repository has been archived by the owner on Jan 26, 2018. It is now read-only.

Commit

Permalink
Merge pull request #5 from Magmodules/development
Browse files Browse the repository at this point in the history
1.5.4
  • Loading branch information
Magmodules authored May 24, 2017
2 parents d23b837 + 725d8c7 commit e971bca
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ public function getStoreIds($type = null)
} else {
$enabled = Mage::helper('feedbackcompany')->isEnabled($store->getId());
}

$clientId = Mage::getStoreConfig(self::XML_CLIENT_ID, $store->getId());
if ($enabled && $clientId) {
$storeIds[$clientId] = $store->getId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public function _construct()
public function addToLog($type, $sId, $review = '', $res = '', $t = '', $cron = '', $aUrl = '', $oId = '')
{
if (Mage::getStoreConfig('feedbackcompany/log/enabled')) {

$company = isset($review['company']) ? $review['company'] : '';

if (empty($company)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public function runUpdate($storeId, $type = 'last_week')
$content = $review['review'];
$title = $this->getFirstSentence($content);
if (!empty($title)) {

$createdAt = $this->reformatDate($review['date_created']);
$nickName = $review['client']['name'];
$ratingVal = $review['rating'];
Expand Down Expand Up @@ -137,6 +136,7 @@ public function getFeed($storeId, $type)
'feed' => $apiResult['data'][0]
);
}

return array(
'status' => 'ERROR',
'error' => isset($apiResult['error']) ? $apiResult['error'] : ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ public function runUpdate($storeId, $type = 'last_week')

if (!isset($feed['feed']['reviews'])) {
return array(
'status' => 'ERROR',
'update' => 0,
'new' => 0
'status' => 'ERROR',
'update' => 0,
'new' => 0,
'error' => 'No Review Data'
);
}

Expand Down Expand Up @@ -126,6 +127,7 @@ public function getFeed($storeId, $type)
'feed' => $apiResult['data'][0]
);
}

return array(
'status' => 'ERROR',
'error' => isset($apiResult['error']) ? $apiResult['error'] : ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public function getFeed($storeId)
'feed' => $apiResult['data'][0]
);
}

return array(
'status' => 'ERROR',
'error' => isset($apiResult['error']) ? $apiResult['error'] : ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function processAction()
$msg = '';
$reviews = Mage::getModel('feedbackcompany/reviews')->runUpdate($storeId, 'full');
$stats = Mage::getModel('feedbackcompany/stats')->runUpdate($storeId);
if (($reviews['new'] > 0) || ($reviews['update'] > 0) || ($reviews['status'] == 'success')) {
if ($reviews['status'] == 'OK') {
$msg = $this->__('%s:', $reviews['company']) . ' ';
$msg .= $this->__('%s new review(s)', $reviews['new']) . ', ';
$msg .= $this->__('%s review(s) updated', $reviews['update']) . ' ';
Expand All @@ -74,6 +74,9 @@ public function processAction()
} elseif (!empty($stats['msg'])) {
$msg = $this->__('ClientId %s: %s', $clientId, $stats['msg']);
Mage::getSingleton('adminhtml/session')->addError($msg);
} elseif (!empty($reviews['error'])) {
$msg = $this->__('ClientId %s: %s', $clientId, $reviews['error']);
Mage::getSingleton('adminhtml/session')->addError($msg);
} else {
$msg = $this->__('ClientId %s: no updates found, feed is empty or not found!', $clientId);
Mage::getSingleton('adminhtml/session')->addError($msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<config>
<modules>
<Magmodules_Feedbackcompany>
<version>1.5.3</version>
<version>1.5.4</version>
</Magmodules_Feedbackcompany>
</modules>
<global>
Expand Down

0 comments on commit e971bca

Please sign in to comment.