From 9fd6ea861b95475bd5d6b77e5a3781cb107bac65 Mon Sep 17 00:00:00 2001 From: Yusuf Davids Date: Wed, 19 Dec 2007 13:28:09 +0000 Subject: [PATCH] KTC-259 "HREF Error when attempting to access a document via a URL that specifies a non-existent document-id" Fixed. Added a boolean variable to the page object which checks for a link. --- lib/templating/kt3template.inc.php | 1 + templates/kt3/standard_page.smarty | 6 ++++++ view.php | 3 +++ 3 files changed, 10 insertions(+), 0 deletions(-) diff --git a/lib/templating/kt3template.inc.php b/lib/templating/kt3template.inc.php index 702a988..b8f0793 100644 --- a/lib/templating/kt3template.inc.php +++ b/lib/templating/kt3template.inc.php @@ -65,6 +65,7 @@ class KTPage { /** context-relevant information */ var $errStack = Array(); + var $booleanLink = false; var $infoStack = Array(); var $portlets = Array(); var $show_portlets = true; diff --git a/templates/kt3/standard_page.smarty b/templates/kt3/standard_page.smarty index f533c7d..c2e7b0c 100644 --- a/templates/kt3/standard_page.smarty +++ b/templates/kt3/standard_page.smarty @@ -332,7 +332,13 @@
{foreach item=sError from=$page->errStack} + + {if ($page->booleanLink == '0')}

{$sError|sanitize}

+ {else} +

{$sError}

+ {/if} + {/foreach}
diff --git a/view.php b/view.php index 8713108..920f897 100755 --- a/view.php +++ b/view.php @@ -115,6 +115,9 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { $oDocument =& Document::get($document_id); if (PEAR::isError($oDocument)) { $this->oPage->addError(sprintf(_kt("The document you attempted to retrieve is invalid. Please browse for one."), KTBrowseUtil::getBrowseBaseUrl())); + + $this->oPage->booleanLink = true; + return $this->do_error(); } $document_id = $oDocument->getId(); -- libgit2 0.21.4