From 7517d5e31876a79e46f10f54dde6ac8724b69e7b Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Tue, 31 Mar 2009 11:23:49 +0200 Subject: [PATCH] Catch empty source root lists. --- chora/lib/Chora.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/chora/lib/Chora.php b/chora/lib/Chora.php index d11c536c1..4cc3a25be 100644 --- a/chora/lib/Chora.php +++ b/chora/lib/Chora.php @@ -42,6 +42,10 @@ class Chora global $acts, $defaultActs, $where, $atdir, $fullname, $sourceroot; $GLOBALS['sourceroots'] = Horde::loadConfiguration('sourceroots.php', 'sourceroots'); + if (is_a($GLOBALS['sourceroots'], 'PEAR_Error')) { + $GLOBALS['notification']->push($GLOBALS['sourceroots']); + $GLOBALS['sourceroots'] = array(); + } $sourceroots = self::sourceroots(); /** @@ -86,9 +90,13 @@ class Chora } } + $acts = array(); + if (!isset($defaultActs['rt'])) { + self::fatal(_("No repositories found.")); + } + /* See if any have been passed as GET variables, and if so, assign * them into the acts array. */ - $acts = array(); foreach ($defaultActs as $key => $default) { $acts[$key] = Util::getFormData($key, $default); } -- 2.11.0