r2828 - fixContext(): check return value of spotEntity() (ticket:51)
authorDenis Ovsienko <infrastation@yandex.ru>
Fri, 5 Jun 2009 14:36:24 +0000 (14:36 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Fri, 5 Jun 2009 14:36:24 +0000 (14:36 +0000)
ChangeLog
inc/functions.php

index 7c85d195bc1371906d87ea48d4eefb6cb424c2bb..41cf87768abb0f90384127f887ff6df4afd12e5e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,5 @@
+0.17.2
+       update: show appropriate message, if a record cannot be found
 0.17.1 2009-06-03
        bugfix: tags were not displayed on "File" page
        bugfix: multiline comment for an added file was stored incorrectly
index b29f64d548bb79c497c4fe0f7dea226f856031f7..045c0ace324781de599c46786ef60d7fcbe736a6 100644 (file)
@@ -1098,7 +1098,19 @@ function fixContext ()
        {
                // Each page listed in the map above requires one uint argument.
                assertUIntArg ($page[$pageno]['bypass'], __FUNCTION__);
-               $target = spotEntity ($etype_by_pageno[$pageno], $_REQUEST[$page[$pageno]['bypass']]);
+               $target_realm = $etype_by_pageno[$pageno];
+               $target_id = $_REQUEST[$page[$pageno]['bypass']];
+               if (NULL === ($target = spotEntity ($target_realm, $target_id)))
+               {
+                       showError
+                               (
+                                       "The record you are requesting isn't in the database (any more)\n" .
+                                       "realm: '${target_realm}'\n" .
+                                       "id: '${target_id}'",
+                                       __FUNCTION__
+                               );
+                       die;
+               }
                $target_given_tags = $target['etags'];
                // Don't reset autochain, because auth procedures could push stuff there in.
                // Another important point is to ignore 'user' realm, so we don't infuse effective