summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-12-07 01:24:44 +0000
committerBharat Mediratta <bharat@menalto.com>2008-12-07 01:24:44 +0000
commit2aa84796f3a7965c7094422412ad005c13c00bd3 (patch)
treecfa46fb2c819ea6e4f9e2002fd7b9f63ca86308f
parentadfe664d96a168d3474c97c633d75db7dd57a4be (diff)
* Don't call _getadd_photo_html() when we don't have an items table.
* Guard against errors when uninstalling modules that don't have any code left (eg: carousel) * Create the var/uploads dir automatically.
-rw-r--r--core/controllers/welcome.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php
index e61ae674..ce036a5f 100644
--- a/core/controllers/welcome.php
+++ b/core/controllers/welcome.php
@@ -37,14 +37,15 @@ class Welcome_Controller extends Template_Controller {
->where("type", "photo")->orderby("level", "desc")->find();
$this->template->album_tree = $this->_load_album_tree();
$this->template->rearrange_html = new View("rearrange.html");
+ $this->template->add_photo_html = $this->_get_add_photo_html();
} catch (Exception $e) {
$this->template->album_count = 0;
$this->template->photo_count = 0;
$this->template->deepest_photo = null;
$this->template->album_tree = array();
$this->template->rearrange_html = "";
+ $this->template->add_photo_html = "";
}
- $this->template->add_photo_html = $this->_get_add_photo_html();
$this->_load_user_info();
$this->_load_group_info();
@@ -93,6 +94,7 @@ class Welcome_Controller extends Template_Controller {
if ($module_name == "core") {
// We have to uninstall all other modules first, else their tables, etc don't
// get cleaned up.
+ $old_handler = set_error_handler(array("Welcome_Controller", "_error_handler"));
try {
foreach (ORM::factory("module")->find_all() as $module) {
if ($module->name != "core" && $module->version) {
@@ -104,6 +106,7 @@ class Welcome_Controller extends Template_Controller {
}
}
} catch (Exception $e) { }
+ set_error_handler($old_handler);
if (!$clean) {
// Since we're in a state of flux, it's possible that other stuff went wrong with the
// uninstall, so back off and nuke things from orbit.
@@ -371,7 +374,7 @@ class Welcome_Controller extends Template_Controller {
}
function _create_directories() {
- foreach (array("logs") as $dir) {
+ foreach (array("logs", "uploads") as $dir) {
@mkdir(VARPATH . "$dir");
}
}