Tags:
create new tag
, view all tags

Patch Proposal: eliminate %TOC% "error" messages

Motivation

The "helpful" error message can get in the way when employing %TOC% in includes and templates and just generally trying to develop a TWikiApplication.

Description

This simple patch eliminates the error message. It seems to serve no useful purpose when viewed in the context of one twiki part incorporating or building on another.

Documentation

N/A

Examples

N/A

Implementation

Index: TWiki.pm
===================================================================
--- TWiki.pm    (revision 3507)
+++ TWiki.pm    (working copy)
@@ -1604,7 +1604,7 @@
         return $result;
 
     } else {
-        return _inlineError("TOC: No TOC in $web.$topicname");
+        return "";
     }
 }

Alternative Implementations

  • Instead of returning an empty string, it would be possible to return qq{<!-- TOC: No TOC in "$web.$topicname" -->}; in the interest of backwards compatability for existing ScreenScrapers.

  • Another possibility is to add a warn parameter à la INCLUDE.

Note: Patch is attached as http://www.twiki.org/p/pub/Codev/TocNotFoundNoError/TocNotFoundNoError.diff. The patch is against SVN 03 Aug 2004


Discussion:

I'd favour the "forget it" approach. If there is nothing to TOC, I don't want to know about it!

-- CrawfordCurrie - 17 Jan 2005

Agreed, and empty TOC has nothing to say and should remain quiet. I do not expect any side effects.

-- PeterThoeny - 18 Jan 2005

Updated patch merged into DEVELOP r3536

-- WillNorris - 18 Jan 2005

 
Topic attachments
I Attachment Action Size Date Who Comment
Unknown file formatdiff TocNotFoundNoError.diff manage 0.3 K 2004-08-03 - 23:38 WillNorris  
Topic revision: r11 - 2005-01-18 - WillNorris
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.