From c7faf4267485395917c7bbb44a351befff0fdeaf Mon Sep 17 00:00:00 2001 From: marcus Date: Wed, 15 Apr 2009 12:51:34 +0000 Subject: Error logged on page forward due to missing page owner. git-svn-id: https://code.elgg.org/elgg/trunk@3209 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/pageowner.php | 9 ++++++++- languages/en.php | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/engine/lib/pageowner.php b/engine/lib/pageowner.php index c2b98c284..f4a4234fb 100644 --- a/engine/lib/pageowner.php +++ b/engine/lib/pageowner.php @@ -67,7 +67,14 @@ * a page does after calling this function is to retrieve the owner entity - which is of course cashed. */ $owner_entity = get_entity($returnval); - if (!$owner_entity) forward(); + if (!$owner_entity) { + + // Log an error + error_log(sprintf(elgg_echo('pageownerunavailable'), $returnval)); + + // Forward + forward(); + } return $returnval; } diff --git a/languages/en.php b/languages/en.php index df94470f7..53b26ba7d 100644 --- a/languages/en.php +++ b/languages/en.php @@ -166,7 +166,9 @@ 'memcache:versiontoolow' => 'Memcache needs at least version %s to run, you are running %s', 'memcache:noaddserver' => 'Multiple server support disabled, you may need to upgrade your PECL memcache library', - 'deprecatedfunction' => 'Warning: This code uses the deprecated function \'%s\' and is not compatible with this version of Elgg', + 'deprecatedfunction' => 'Warning: This code uses the deprecated function \'%s\' and is not compatible with this version of Elgg', + + 'pageownerunavailable' => 'Warning: The page owner %d is not accessible!', /** * API */ -- cgit v1.2.3