• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

SVN 12059 broke Tooltip readon link when included in left bar

It seems that the formatted search returns a different value for $topic when included in the left bar. It works if I remove the prefixing $web.

It is a bit mysterious. I can see how I can quickly fix it. But I do not understand the fix.

It seems inside the formatted search the [[$web.$topic][something]] does not always mean the same.

If the something is a $pattern then the $topic is just the topic name. If not then the topic includes the web name.

So if I fix it I may just mask off a real error in the formatted search.

I am setting this urgent until we know what the mechanics are.


This change to TWikiTipsOfTheDayInclude works but why?

%CALC{$NOP(%)SEARCH{ \"^$GET(topic)$\" web=\"$GET(web)\" scope="topic" regex="on" nosearch=\"on\" noheader=\"on\" nototal=\"on\" limit=\"1\" format=\"<span class=\\"tipsOfTheDayTitle\\">[[$web.$topic][$pattern(.*?\-\-\-\+([^\n\r]+).*)]]</span><br /> $summary(100, noheader) [[$topic][%MAKETEXT{"Read on"}%&nbsp;<img src=\\"%ICONURL{more-small}%\\" alt=\\"Read more\\" title=\\"Read on\\" width=\\"13\\" height=\\"13\\" border=\\"0\\" />]]\"}$NOP(%)}%

The change is that the second square bracket link I removed a $web.



First things first: The bug is readily seen in Sandbox.WebHome. Sorry, Kenneth, your fix isn't good enough. The TWiki tips are written so that they would pick Tips from both the TWiki and Main webs, your fix will always have TWiki. inserted (because that's where the include comes from).

In the current case, the bug is related to (but not caused by) the SpreadSheetPlugin, but perhaps we'll be able to find other (abstruse) cases if we look carefully.

Here's what happens:

  1. The SpreadSheetPlugin is per default configured so that it is not evaluated at INCLUDE time.
  2. Therefore, the SEARCH is not performed: it is still disabled by SSP's $NOP(%).
  3. The including web (Sandbox) is different from the included web (TWiki), so link "fixing" kicks in.
    • At least, it is assumed to kick in. It does not in the case of the pattern.
  4. Link fixing (in TWiki::fixIncludeLink) is confused by [[$web.$topic]], which it fails to parse into Web.TopicName (it doesn't match the regexes), hence it adds the included web TWiki, yielding [[TWiki.$web.$topic]]

Fixing such a central piece of code shouldn't be done after midnight, so please be patient - but the analysis is clear. Given the code freeze it might be preferrable to simply revert r12059. The thing we lose if we revert is the CSS classes which are only added to web.topic thingies.

Ah - why doesn't the bug appear in the case of a pattern as link text? Because the pattern contains a single ], so it isn't even considered as a squabbed link which would need fixing. This is the area where abstruse errors could be constructed.


Good forensic work Harald. This is a very special case, I suggest not to worry about fixing FormattedSearch, it might break something else.

I reverted the change to use a full URL instead of web.topic.

-- PTh

I knew my fix was not good enough. That is why I did not check it in smile

I agree not to try and fix this special case and to use the full URL. Great work both Harald and Peter.


Summary SVN 12059 broke Tooltip readon link when included in left bar.
ReportedBy TWiki:Main.KennethLavrsen
Codebase ~twiki4, 4.0.5
SVN Range TWiki-4.1, Tue, 28 Nov 2006, build 12081
AppliesTo Engine

Priority Urgent
CurrentState Closed

Checkins 12287
TargetRelease n/a
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r6 - 2006-12-17 - KennethLavrsen
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback