From be80eeb5fde6595361649dc1b7556e09a199d346 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 14 Sep 2012 18:20:46 -0400 Subject: [PATCH 1/8] CC-4404: restart airtime-liquidsoap will interrupt the output stream and never resume until restart playout engine -fixed --- .../application/controllers/ApiController.php | 1 + airtime_mvc/application/models/RabbitMq.php | 4 +- .../pypo/liquidsoap_scripts/ls_lib.liq | 1 - .../pypo/liquidsoap_scripts/ls_script.liq | 106 +++++++++--------- python_apps/pypo/pypofetch.py | 4 +- python_apps/pypo/pypopush.py | 2 - 6 files changed, 61 insertions(+), 57 deletions(-) diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index 94cb7e518..033369802 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -796,6 +796,7 @@ class ApiController extends Zend_Controller_Action { Logging::info("Notifying RabbitMQ to send message to pypo"); + Application_Model_RabbitMq::SendMessageToPypo("reset_liquidsoap_bootstrap", array()); Application_Model_RabbitMq::PushSchedule(); } diff --git a/airtime_mvc/application/models/RabbitMq.php b/airtime_mvc/application/models/RabbitMq.php index ab73a018f..d92975413 100644 --- a/airtime_mvc/application/models/RabbitMq.php +++ b/airtime_mvc/application/models/RabbitMq.php @@ -3,14 +3,14 @@ require_once 'php-amqplib/amqp.inc'; class Application_Model_RabbitMq { - public static $doPush = FALSE; + public static $doPush = false; /** * Sets a flag to push the schedule at the end of the request. */ public static function PushSchedule() { - Application_Model_RabbitMq::$doPush = TRUE; + self::$doPush = true; } private static function sendMessage($exchange, $data) diff --git a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq index 085d03661..17aadbb8e 100644 --- a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq +++ b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq @@ -399,7 +399,6 @@ dyn_out = output.icecast(%wav, def set_dynamic_source_id(id) = current_dyn_id := id - #"Done!" string_of(!current_dyn_id) end diff --git a/python_apps/pypo/liquidsoap_scripts/ls_script.liq b/python_apps/pypo/liquidsoap_scripts/ls_script.liq index 7b04210b4..87e7fbc89 100644 --- a/python_apps/pypo/liquidsoap_scripts/ls_script.liq +++ b/python_apps/pypo/liquidsoap_scripts/ls_script.liq @@ -19,7 +19,6 @@ queue = amplify(1., override="replay_gain", queue) #live stream setup set("harbor.bind_addr", "0.0.0.0") -#TODO: Need to create a randomized password for every instance current_dyn_id = ref '' pypo_data = ref '0' @@ -49,7 +48,10 @@ queue = map_metadata(update=false, append_title, queue) queue = crossfade(queue) -stream_queue = switch(id="stream_queue_switch", track_sensitive=false, transitions=[transition, transition], [({!webstream_enabled},web_stream), ({true}, queue)]) +stream_queue = switch(id="stream_queue_switch", track_sensitive=false, + transitions=[transition, transition], + [({!webstream_enabled},web_stream), + ({true}, queue)]) ignore(output.dummy(stream_queue, fallible=true)) @@ -113,31 +115,31 @@ ignore(output.dummy(default, fallible=true)) master_dj_enabled = ref false live_dj_enabled = ref false -scheduled_play_enabled = ref false +scheduled_play_enabled = ref false def make_master_dj_available() - master_dj_enabled := true + master_dj_enabled := true end def make_master_dj_unavailable() - master_dj_enabled := false + master_dj_enabled := false end def make_live_dj_available() - live_dj_enabled := true + live_dj_enabled := true end def make_live_dj_unavailable() - live_dj_enabled := false + live_dj_enabled := false end def make_scheduled_play_available() - scheduled_play_enabled := true - just_switched := true + scheduled_play_enabled := true + just_switched := true end def make_scheduled_play_unavailable() - scheduled_play_enabled := false + scheduled_play_enabled := false end def update_source_status(sourcename, status) = @@ -163,23 +165,23 @@ end #auth function for live stream def check_master_dj_client(user,password) = - log("master connected") - #get the output of the php script - ret = get_process_lines("python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_auth.py --master #{user} #{password}") - #ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ... - ret = list.hd(ret) - - #return true to let the client transmit data, or false to tell harbor to decline - ret == "True" + log("master connected") + #get the output of the php script + ret = get_process_lines("python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_auth.py --master #{user} #{password}") + #ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ... + ret = list.hd(ret) + + #return true to let the client transmit data, or false to tell harbor to decline + ret == "True" end def check_dj_client(user,password) = - log("live dj connected") - #get the output of the php script - ret = get_process_lines("python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_auth.py --dj #{user} #{password}") - #ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ... - hd = list.hd(ret) - hd == "True" + log("live dj connected") + #get the output of the php script + ret = get_process_lines("python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_auth.py --dj #{user} #{password}") + #ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ... + hd = list.hd(ret) + hd == "True" end def append_dj_inputs(master_harbor_input_port, master_harbor_input_mount_point, dj_harbor_input_port, dj_harbor_input_mount_point, s) = @@ -214,46 +216,48 @@ def append_dj_inputs(master_harbor_input_port, master_harbor_input_mount_point, end end -s = switch(id="default_switch", track_sensitive=false, transitions=[transition_default, transition], [({!scheduled_play_enabled},stream_queue),({true},default)]) -s = append_dj_inputs(master_live_stream_port, master_live_stream_mp, dj_live_stream_port, dj_live_stream_mp, s) +s = switch(id="default_switch", track_sensitive=false, + transitions=[transition_default, transition], + [({!scheduled_play_enabled}, stream_queue),({true},default)]) +s = append_dj_inputs(master_live_stream_port, master_live_stream_mp, + dj_live_stream_port, dj_live_stream_mp, s) # Attach a skip command to the source s: add_skip_command(s) server.register(namespace="streams", - description="Stop Master DJ source.", - usage="master_dj_stop", - "master_dj_stop", - fun (s) -> begin log("streams.master_dj_stop") make_master_dj_unavailable() "Done." end) + description="Stop Master DJ source.", + usage="master_dj_stop", + "master_dj_stop", + fun (s) -> begin log("streams.master_dj_stop") make_master_dj_unavailable() "Done." end) server.register(namespace="streams", - description="Start Master DJ source.", - usage="master_dj_start", - "master_dj_start", - fun (s) -> begin log("streams.master_dj_start") make_master_dj_available() "Done." end) + description="Start Master DJ source.", + usage="master_dj_start", + "master_dj_start", + fun (s) -> begin log("streams.master_dj_start") make_master_dj_available() "Done." end) server.register(namespace="streams", - description="Stop Live DJ source.", - usage="live_dj_stop", - "live_dj_stop", - fun (s) -> begin log("streams.live_dj_stop") make_live_dj_unavailable() "Done." end) + description="Stop Live DJ source.", + usage="live_dj_stop", + "live_dj_stop", + fun (s) -> begin log("streams.live_dj_stop") make_live_dj_unavailable() "Done." end) server.register(namespace="streams", - description="Start Live DJ source.", - usage="live_dj_start", - "live_dj_start", - fun (s) -> begin log("streams.live_dj_start") make_live_dj_available() "Done." end) + description="Start Live DJ source.", + usage="live_dj_start", + "live_dj_start", + fun (s) -> begin log("streams.live_dj_start") make_live_dj_available() "Done." end) server.register(namespace="streams", - description="Stop Scheduled Play source.", - usage="scheduled_play_stop", - "scheduled_play_stop", - fun (s) -> begin log("streams.scheduled_play_stop") make_scheduled_play_unavailable() "Done." end) + description="Stop Scheduled Play source.", + usage="scheduled_play_stop", + "scheduled_play_stop", + fun (s) -> begin log("streams.scheduled_play_stop") make_scheduled_play_unavailable() "Done." end) server.register(namespace="streams", - description="Start Scheduled Play source.", - usage="scheduled_play_start", - "scheduled_play_start", - fun (s) -> begin log("streams.scheduled_play_start") make_scheduled_play_available() "Done." end) + description="Start Scheduled Play source.", + usage="scheduled_play_start", + "scheduled_play_start", + fun (s) -> begin log("streams.scheduled_play_start") make_scheduled_play_available() "Done." end) if output_sound_device then - success = ref false log(output_sound_device_type) diff --git a/python_apps/pypo/pypofetch.py b/python_apps/pypo/pypofetch.py index 9cd069b44..87e527866 100644 --- a/python_apps/pypo/pypofetch.py +++ b/python_apps/pypo/pypofetch.py @@ -85,6 +85,8 @@ class PypoFetch(Thread): if command == 'update_schedule': self.schedule_data = m['schedule'] self.process_schedule(self.schedule_data) + elif command == 'reset_liquidsoap_bootstrap': + self.set_bootstrap_variables() elif command == 'update_stream_setting': self.logger.info("Updating stream setting...") self.regenerate_liquidsoap_conf(m['setting']) @@ -173,7 +175,7 @@ class PypoFetch(Thread): def set_bootstrap_variables(self): self.logger.debug('Getting information needed on bootstrap from Airtime') info = self.api_client.get_bootstrap_info() - if info == None: + if info is None: self.logger.error('Unable to get bootstrap info.. Exiting pypo...') sys.exit(1) else: diff --git a/python_apps/pypo/pypopush.py b/python_apps/pypo/pypopush.py index 1a9672872..4defee3e9 100644 --- a/python_apps/pypo/pypopush.py +++ b/python_apps/pypo/pypopush.py @@ -473,8 +473,6 @@ class PypoPush(Thread): msg = 'streams.scheduled_play_start\n' tn.write(msg) - - msg = 'dynamic_source.output_start\n' self.logger.debug(msg) tn.write(msg) From c0f3395a6134c646505cfda06c3e9cb4895e6bea Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 14 Sep 2012 19:01:21 -0400 Subject: [PATCH 2/8] CC-4404: restart airtime-liquidsoap will interrupt the output stream and never resume until restart playout engine -fixed --- python_apps/pypo/pypofetch.py | 2 ++ python_apps/pypo/pypomessagehandler.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/python_apps/pypo/pypofetch.py b/python_apps/pypo/pypofetch.py index 87e527866..720b1eef4 100644 --- a/python_apps/pypo/pypofetch.py +++ b/python_apps/pypo/pypofetch.py @@ -105,6 +105,8 @@ class PypoFetch(Thread): elif command == 'disconnect_source': self.logger.info("disconnect_on_source show command received...") self.disconnect_source(self.logger, self.telnet_lock, m['sourcename']) + else: + self.logger.info("Unknown command: %s" % command) # update timeout value if command == 'update_schedule': diff --git a/python_apps/pypo/pypomessagehandler.py b/python_apps/pypo/pypomessagehandler.py index bdc9c66d9..396f13fba 100644 --- a/python_apps/pypo/pypomessagehandler.py +++ b/python_apps/pypo/pypomessagehandler.py @@ -68,6 +68,9 @@ class PypoMessageHandler(Thread): if command == 'update_schedule': self.logger.info("Updating schdule...") self.pypo_queue.put(message) + elif command == 'reset_liquidsoap_bootstrap': + self.logger.info("Resetting bootstrap vars...") + self.pypo_queue.put(message) elif command == 'update_stream_setting': self.logger.info("Updating stream setting...") self.pypo_queue.put(message) @@ -90,6 +93,8 @@ class PypoMessageHandler(Thread): self.recorder_queue.put(message) elif command == 'cancel_recording': self.recorder_queue.put(message) + else: + self.logger.info("Unknown command: %s" % command) except Exception, e: self.logger.error("Exception in handling RabbitMQ message: %s", e) From 5d0592c72936ff60cb691717f019aae292cfe32a Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 17 Sep 2012 12:32:39 -0400 Subject: [PATCH 3/8] CC-4454: Show deleting: if you do 'delete this instance and all following', it doesn't remove entries from cc_schedule table -fixed --- .../controllers/ScheduleController.php | 3 +- airtime_mvc/application/models/Schedule.php | 2 ++ airtime_mvc/application/models/Show.php | 33 +++++++------------ .../application/models/ShowInstance.php | 6 ++-- 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 8d9382717..32e2a3fc6 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -190,8 +190,9 @@ class ScheduleController extends Zend_Controller_Action if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { try { - $showInstance = new Application_Model_ShowInstance($showInstanceId); + $showInstance = new Application_Model_ShowInstance($showInstanceId); } catch (Exception $e) { + Logging::info($e->getMessage()); $this->view->show_error = true; return false; diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index eb538f57f..4914302b6 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -558,6 +558,7 @@ WHERE st.ends > :startTime1 AND st.starts < :endTime AND st.playout_status > 0 AND si.ends > :startTime2 + AND si.modified_instance = 'f' ORDER BY st.starts SQL; @@ -578,6 +579,7 @@ WHERE st.ends > :startTime1 AND st.starts < :rangeEnd AND st.playout_status > 0 AND si.ends > :startTime2 + AND si.modified_instance = 'f' ORDER BY st.starts LIMIT 3 SQL; diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index 4cb90d1bc..7f905b687 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -275,8 +275,6 @@ SQL; public function cancelShow($day_timestamp) { - $con = Propel::getConnection(); - $timeinfo = explode(" ", $day_timestamp); CcShowDaysQuery::create() @@ -284,30 +282,23 @@ SQL; ->update(array('DbLastShow' => $timeinfo[0])); $sql = <<= :dayTimestamp::TIMESTAMP AND show_id = :showId SQL; - - Application_Common_Database::prepareAndExecute( $sql, array( + + $rows = Application_Common_Database::prepareAndExecute( $sql, array( ':dayTimestamp' => $day_timestamp, - ':showId' => $this->getId()), 'execute'); + ':showId' => $this->getId()), 'all'); - // check if we can safely delete the show - $showInstancesRow = CcShowInstancesQuery::create() - ->filterByDbShowId($this->_showId) - ->filterByDbModifiedInstance(false) - ->findOne(); - - if (is_null($showInstancesRow)) { - $sql = << $this->_showId ), "execute"); - $con->exec($sql); - } + foreach ($rows as $row) { + try { + $showInstance = new Application_Model_ShowInstance($row["id"]); + $showInstance->delete($rabbitmqPush = false); + } catch (Exception $e) { + Logging::info($e->getMessage()); + } + } Application_Model_RabbitMq::PushSchedule(); } diff --git a/airtime_mvc/application/models/ShowInstance.php b/airtime_mvc/application/models/ShowInstance.php index e6a3dcc58..f88a1d63a 100644 --- a/airtime_mvc/application/models/ShowInstance.php +++ b/airtime_mvc/application/models/ShowInstance.php @@ -518,7 +518,7 @@ SQL; return false; } - public function delete() + public function delete($rabbitmqPush = true) { // see if it was recording show $recording = $this->isRecorded(); @@ -568,7 +568,9 @@ SQL; } } - Application_Model_RabbitMq::PushSchedule(); + if ($rabbitmqPush) { + Application_Model_RabbitMq::PushSchedule(); + } } public function setRecordedFile($file_id) From 2337078dd84a1e5332ef357f89f85c0abdd41eb3 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 17 Sep 2012 12:35:12 -0400 Subject: [PATCH 4/8] Cleaned up unused variables. Formatted some lines. --- airtime_mvc/application/controllers/ScheduleController.php | 1 - airtime_mvc/application/models/Soundcloud.php | 2 +- airtime_mvc/application/models/StoredFile.php | 4 +++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 8d9382717..c567a510f 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -205,7 +205,6 @@ class ScheduleController extends Zend_Controller_Action public function uploadToSoundCloudAction() { - global $CC_CONFIG; $show_instance = $this->_getParam('id'); try { $show_inst = new Application_Model_ShowInstance($show_instance); diff --git a/airtime_mvc/application/models/Soundcloud.php b/airtime_mvc/application/models/Soundcloud.php index 1c4b94f9f..b6d8cedfc 100644 --- a/airtime_mvc/application/models/Soundcloud.php +++ b/airtime_mvc/application/models/Soundcloud.php @@ -33,7 +33,7 @@ class Application_Model_Soundcloud $tags = Application_Model_Preference::GetSoundCloudTags(); } - $downloadable = Application_Model_Preference::GetSoundCloudDownloadbleOption() == '1'?true:false; + $downloadable = Application_Model_Preference::GetSoundCloudDownloadbleOption() == '1'; $track_data = array( 'track[sharing]' => 'private', diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index 006593314..3469c75c9 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -1170,7 +1170,9 @@ SQL; $release = $file->getDbYear(); try { $soundcloud = new Application_Model_Soundcloud(); - $soundcloud_res = $soundcloud->uploadTrack($this->getFilePath(), $this->getName(), $description, $tag, $release, $genre); + $soundcloud_res = $soundcloud->uploadTrack( + $this->getFilePath(), $this->getName(), $description, + $tag, $release, $genre); $this->setSoundCloudFileId($soundcloud_res['id']); $this->setSoundCloudLinkToFile($soundcloud_res['permalink_url']); $this->setSoundCloudUploadTime(new DateTime("now"), new DateTimeZone("UTC")); From 92a5bf51a689955637e7a7718319c1a969b8bbe2 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 17 Sep 2012 12:45:33 -0400 Subject: [PATCH 5/8] Added warning for uploading unknown file types --- airtime_mvc/application/controllers/LibraryController.php | 8 +++++--- airtime_mvc/application/models/Soundcloud.php | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/airtime_mvc/application/controllers/LibraryController.php b/airtime_mvc/application/controllers/LibraryController.php index e05747200..fa6a92e68 100644 --- a/airtime_mvc/application/controllers/LibraryController.php +++ b/airtime_mvc/application/controllers/LibraryController.php @@ -486,10 +486,12 @@ class LibraryController extends Zend_Controller_Action $this->view->error_code = $file->getSoundCloudErrorCode(); $this->view->error_msg = $file->getSoundCloudErrorMsg(); } elseif ($type == "file") { - $file = Application_Model_StoredFile::Recall($id); - $this->view->sc_id = $file->getSoundCloudId(); + $file = Application_Model_StoredFile::Recall($id); + $this->view->sc_id = $file->getSoundCloudId(); $this->view->error_code = $file->getSoundCloudErrorCode(); - $this->view->error_msg = $file->getSoundCloudErrorMsg(); + $this->view->error_msg = $file->getSoundCloudErrorMsg(); + } else { + Logging::warn("Trying to upload unknown type: $type with id: $id"); } } } diff --git a/airtime_mvc/application/models/Soundcloud.php b/airtime_mvc/application/models/Soundcloud.php index b6d8cedfc..7e2b74d57 100644 --- a/airtime_mvc/application/models/Soundcloud.php +++ b/airtime_mvc/application/models/Soundcloud.php @@ -23,7 +23,8 @@ class Application_Model_Soundcloud return $token; } - public function uploadTrack($filepath, $filename, $description, $tags=array(), $release=null, $genre=null) + public function uploadTrack($filepath, $filename, $description, + $tags=array(), $release=null, $genre=null) { if ($this->getToken()) { if (count($tags)) { From fef949f6eabc52acb8d63bfbd221cf906dec4eb7 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 17 Sep 2012 12:50:04 -0400 Subject: [PATCH 6/8] band aided some bug --- airtime_mvc/application/models/Preference.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 807d23b6d..33059cebd 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -1100,7 +1100,17 @@ class Application_Model_Preference return function ($x) { return $x; }; } else { $ds = unserialize($v); - return function ($x) use ($ds) { return $ds['ColReorder'][$x]; } ; + return function ($x) use ($ds) { + if ( in_array($ds['ColReorder'], $x) ) { + return $ds['ColReorder'][$x]; + } else { + Logging::warn("Index $x does not exist preferences"); + Logging::warn("Defaulting to identity and printing + preferences"); + Logging::warn($ds); + return $x; + } + } ; } } From c7c74e18a7f4a2b01a5cf75d45b2988b85148150 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 17 Sep 2012 14:17:22 -0400 Subject: [PATCH 7/8] removed carriege returns --- utils/soundcloud-uploader.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utils/soundcloud-uploader.php b/utils/soundcloud-uploader.php index e7b116785..ea6826aab 100644 --- a/utils/soundcloud-uploader.php +++ b/utils/soundcloud-uploader.php @@ -24,11 +24,11 @@ require_once($CC_CONFIG['phpDir'].'/application/configs/conf.php'); $CC_CONFIG['phpDir'] = $values['general']['airtime_dir']; -// Ensure library/ is on include_path -set_include_path(implode(PATH_SEPARATOR, array( - get_include_path(), - realpath($CC_CONFIG['phpDir'] . '/library') -))); +// Ensure library/ is on include_path +set_include_path(implode(PATH_SEPARATOR, array( + get_include_path(), + realpath($CC_CONFIG['phpDir'] . '/library') +))); require_once($CC_CONFIG['phpDir'].'/application/models/StoredFile.php'); require_once($CC_CONFIG['phpDir'].'/application/models/Preference.php'); From ed45011b40b00ae5496c7a4a8e38708a5c23de16 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 17 Sep 2012 14:21:13 -0400 Subject: [PATCH 8/8] needle <-> haystack --- airtime_mvc/application/models/Preference.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 33059cebd..c73426a2d 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -1101,7 +1101,7 @@ class Application_Model_Preference } else { $ds = unserialize($v); return function ($x) use ($ds) { - if ( in_array($ds['ColReorder'], $x) ) { + if ( in_array($x, $ds['ColReorder'] ) ) { return $ds['ColReorder'][$x]; } else { Logging::warn("Index $x does not exist preferences");