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 https://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

Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r11 - 2005-01-18 - WillNorris
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.