From 0a42d74d5564efdfbbc7c575211d0954d7a01488 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 10 Jul 2010 15:10:13 -0700 Subject: Reset the time limit to 30 seconds every time we delete a child. Fixes ticket #1199. --- modules/gallery/libraries/ORM_MPTT.php | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/gallery/libraries') diff --git a/modules/gallery/libraries/ORM_MPTT.php b/modules/gallery/libraries/ORM_MPTT.php index e5b8ecd4..3a780d9e 100644 --- a/modules/gallery/libraries/ORM_MPTT.php +++ b/modules/gallery/libraries/ORM_MPTT.php @@ -92,6 +92,7 @@ class ORM_MPTT_Core extends ORM { // Deleting children affects the MPTT tree, so we have to reload each child before we // delete it so that we have current left_ptr/right_ptr pointers. This is inefficient. // @todo load each child once, not twice. + set_time_limit(30); $item->reload()->delete(); } -- cgit v1.2.3 From b7cd2f73c55d600935548abb1282444a592e20a0 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 10 Jul 2010 15:18:54 -0700 Subject: PHPDoc fix. --- modules/gallery/libraries/ORM_MPTT.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery/libraries') diff --git a/modules/gallery/libraries/ORM_MPTT.php b/modules/gallery/libraries/ORM_MPTT.php index 3a780d9e..d8d88e4e 100644 --- a/modules/gallery/libraries/ORM_MPTT.php +++ b/modules/gallery/libraries/ORM_MPTT.php @@ -176,7 +176,7 @@ class ORM_MPTT_Core extends ORM { } /** - * Return all of the children of this node, ordered by id. + * Return the number of children of this node. * * @chainable * @param array additional where clauses -- cgit v1.2.3 From adeea49e0a4b4d68e389b0d286957d24a5e16bb6 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 21 Jul 2010 11:43:51 -0700 Subject: Catch any exceptions thrown when we try to restore the original identity provider after we fail to set up a new one. --- modules/gallery/libraries/IdentityProvider.php | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'modules/gallery/libraries') diff --git a/modules/gallery/libraries/IdentityProvider.php b/modules/gallery/libraries/IdentityProvider.php index 067a9929..5f341c90 100644 --- a/modules/gallery/libraries/IdentityProvider.php +++ b/modules/gallery/libraries/IdentityProvider.php @@ -99,18 +99,24 @@ class IdentityProvider_Core { $restore_already_running = true; // Make sure new provider is not in the database - module::uninstall($new_provider); - - // Lets reset to the current provider so that the gallery installation is still - // working. - module::set_var("gallery", "identity_provider", null); - IdentityProvider::change_provider($current_provider); - module::activate($current_provider); + try { + module::uninstall($new_provider); + + // Lets reset to the current provider so that the gallery installation is still + // working. + module::set_var("gallery", "identity_provider", null); + IdentityProvider::change_provider($current_provider); + module::activate($current_provider); + } catch (Exception $e2) { + Kohana_Log::add("error", "Error restoring original identity provider\n" . + $e2->getMessage() . "\n" . $e2->getTraceAsString()); + } + message::error( t("Error attempting to enable \"%new_provider\" identity provider, " . "reverted to \"%old_provider\" identity provider", array("new_provider" => $new_provider, "old_provider" => $current_provider))); - + $restore_already_running = false; } throw $e; -- cgit v1.2.3 From ebbb73787d6f935354478d4bdbe626c163c90a9c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 29 Jul 2010 19:37:38 -0700 Subject: Trap ORM_Validation_Exception specially and report which fields failed validation. --- modules/gallery/libraries/MY_View.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/gallery/libraries') diff --git a/modules/gallery/libraries/MY_View.php b/modules/gallery/libraries/MY_View.php index d76e25ff..ded77792 100644 --- a/modules/gallery/libraries/MY_View.php +++ b/modules/gallery/libraries/MY_View.php @@ -67,6 +67,10 @@ class View extends View_Core { try { $this->kohana_local_data = array_merge(View::$global_data, $this->kohana_local_data); return parent::render($print, $renderer, $modifier); + } catch (ORM_Validation_Exception $e) { + Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString()); + Kohana_Log::add("error", "Validation errors: " . print_r($e->validation->errors(), 1)); + return ""; } catch (Exception $e) { Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString()); return ""; -- cgit v1.2.3