From 7a8bf6ea263d339a47239a2e0b934f6b79b9bbec Mon Sep 17 00:00:00 2001
From: Roeland Jago Douma <roeland@famdouma.nl>
Date: Tue, 15 Nov 2016 18:10:17 +0100
Subject: [PATCH] Fix tests

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
---
 lib/private/legacy/util.php | 24 +++++++++---------------
 lib/public/Util.php         |  1 -
 2 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php
index 3ffd3bd3ccd..3bd5b5586ab 100644
--- a/lib/private/legacy/util.php
+++ b/lib/private/legacy/util.php
@@ -427,6 +427,12 @@ class OC_Util {
 	 */
 	public static function getChannel() {
 		OC_Util::loadVersion();
+
+		// Allow overriding update channel
+		if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
+			self::$versionCache['OC_Channel'] = \OC::$server->getAppConfig()->getValue('core', 'OC_Channel');
+		}
+
 		return self::$versionCache['OC_Channel'];
 	}
 
@@ -457,21 +463,9 @@ class OC_Util {
 		self::$versionCache['OC_VersionString'] = $OC_VersionString;
 		/** @var $OC_Build string */
 		self::$versionCache['OC_Build'] = $OC_Build;
-			
-		// Allow overriding update channel
-		if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
-			$channel = \OC::$server->getAppConfig()->getValue('core', 'OC_Channel');
-		} else {
-			/** @var $OC_Channel string */
-			$channel = $OC_Channel;
-		}
-			
-		if (!is_null($channel)) {
-			self::$versionCache['OC_Channel'] = $channel;
-		} else {
-			/** @var $OC_Channel string */
-			self::$versionCache['OC_Channel'] = $OC_Channel;
-		}
+
+		/** @var $OC_Channel string */
+		self::$versionCache['OC_Channel'] = $OC_Channel;
 	}
 
 	/**
diff --git a/lib/public/Util.php b/lib/public/Util.php
index 08661fd88ca..8a7c8997613 100644
--- a/lib/public/Util.php
+++ b/lib/public/Util.php
@@ -83,7 +83,6 @@ class Util {
 	 */
 	public static function setChannel($channel) {
 		//Flush timestamp to reload version.php
-		\OC::$server->getSession()->set('OC_Version_Timestamp', 0);
 		\OC::$server->getAppConfig()->setValue('core', 'OC_Channel', $channel);
 		\OC::$server->getConfig()->setSystemValue('updater.release.channel', $channel);
 	}
-- 
GitLab