Skip to content

Commit

Permalink
Fixed #7936: stable version shows beta update while only stable reque…
Browse files Browse the repository at this point in the history
…sted

dev: still need to fix beta channel, maybe need different setting for report beta/stable/both on manual check.
  • Loading branch information
mennodekker committed Jun 19, 2013
1 parent 0304d68 commit d8ccf36
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions application/helpers/common_helper.php
Expand Up @@ -5702,20 +5702,36 @@ function updateCheck()
if (count($updateinfo) && trim(Yii::app()->getConfig('buildnumber'))!='')
{
setGlobalSetting('updateversions',json_encode($updateinfo));
if (isset($updateinfo['master'])){
$updateinfo=$updateinfo['master'];
}
else
$sUpdateNotificationType = getGlobalSetting('updatenotification');
switch ($sUpdateNotificationType)
{
$updateinfo=reset($updateinfo);
case 'stable':
// Only show update if in stable (master) branch
if (isset($updateinfo['master'])) {
$updateinfo=$updateinfo['master'];
} else {
unset ($updateinfo);
}
break;

case 'both':
// Show first available update
$updateinfo=reset($updateinfo);
break;

default:
// Never show a notification
unset($updateinfo);
break;
}
}
if (isset($updateinfo)) {
setGlobalSetting('updateavailable',1);
setGlobalSetting('updatebuild',$updateinfo['build']);
setGlobalSetting('updateversion',$updateinfo['versionnumber']);
}
else
{
setGlobalSetting('updateavailable',0);
} else {
setGlobalSetting('updateavailable',0);
$updateinfo = array();
}
setGlobalSetting('updatelastcheck',date('Y-m-d H:i:s'));
return $updateinfo;
Expand Down

0 comments on commit d8ccf36

Please sign in to comment.