cross
New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists
You are here: Foswiki>Tasks Web>Item11623 (11 Apr 2012, GeorgeClark)Edit Attach

Item11623: The pattern skin revision info has an odd failure mode when a TOPICINFO.author is a wikiname that isn't a valid cuid anymore

pencil
Priority: Normal
Current State: Closed
Released In: 1.1.5
Target Release: patch
Applies To: Engine
Component:
Branches: Release01x01 trunk
Reported By: SvenDowideit
Waiting For:
Last Change By: GeorgeClark
on this 1.1.4 system, %REVINFO% is expanding with no web prefix for the $wikiusername

-- SvenDowideit - 08 Mar 2012

looks like PatternSkin uses 2 different forms of REVINFO - the top breadcrumb one uses USERSWEB.$wikiname, while the topicInfo below the action bar uses the default $wikiusername

and in both cases, on this server, its failing to find the author, but the rendering result is a mess.

I think I'm going to ammend PatternSkin to be consistent.

-- SvenDowideit - 08 Mar 2012

i wonder what happens to non-view output :/

-- SvenDowideit - 08 Mar 2012

  1. compare appears to fake it too,
  2. compare 2 revisions directly seems to not mention who did it at all - bug
  3. backlinks uses wikiname, so makes a local web link

ok, bleaugh - from view.pattern.tmpl:

%TMPL:DEF{"breadcrumb:annotation"}%%IF{"defined rev" then=" %MAKETEXT{"(revision [_1])" args="%URLPARAM{"rev"}%"}%" else=" <span class='patternRevInfo'>(%REVINFO{format="$date, $percntIF{$quotistopic '%USERSWEB%.$wikiname'$quot then=$quot[[%USERSWEB%.$wikiname][$wikiname]]$quot else=$quot$nop$wikiname"}%$quot}$percnt)</span>"}%%IF{"defined raw" then=" %MAKETEXT{"(raw view)"}%"}%%TMPL:END%

to test it here:

%IF{
   "defined rev" 
   then=" %MAKETEXT{"(revision [_1])" args="%URLPARAM{"rev"}%"}%" 
   else=" <span class='patternRevInfo'>(%REVINFO{
                                              format="$date, $percntIF{$quotistopic '%USERSWEB%.$wikiname'$quot then=$quot[[%USERSWEB%.$wikiname][$wikiname]]$quot else=$quot$nop$wikiname"
                                        }%$quot}$percnt)</span>"
}%%IF{
        "defined raw" 
        then=" %MAKETEXT{"(raw view)"
}%"
}%

just the bit thats confusing me renders to:

(11 Apr 2012, %IF{"istopic 'Main.GeorgeClark'" then="GeorgeClark" else="GeorgeClark$quot}$percnt)

I don't understand why pat of the IF is inside the REVINFO and part is outside, but TML macros means that it works - its just ugly as.

%IF{
   "defined rev" 
   then=" %MAKETEXT{"(revision [_1])" args="%URLPARAM{"rev"}%"}%" 
   else=" <span class='patternRevInfo'>(%REVINFO{
                                              format="$date, $percntIF{$quotistopic '%USERSWEB%.$wikiname'$quot then=$quot[[%USERSWEB%.$wikiname][$wikiname]]$quot else=$quot$nop$wikiname$quot}$percnt"
                                        }%)</span>"
}%%IF{
        "defined raw" 
        then=" %MAKETEXT{"(raw view)"
}%"
}%

-- SvenDowideit - 08 Mar 2012

ah, the default SEARCH formatting is also susceptible to this frown, sad smile


its still not perfect - if the mapper denies knowledge of the cuid, and the topic does not exist in USERSWEB, we provide a WikiWord link to the BASEWEB

I'm not sure if I should test for wikiword-ness and if its one prepend USERSWEB - might make the most sense tho


ah, no, it turns out that using $nop in this REVINFO/IF mess doesn't stop WikiWeird rendering, whereas a ! does.

and so I think I've fixed it completely now.

DAMN. I broke something - I'll look at it tomorrow.

-- SvenDowideit - 08 Mar 2012

last time i hope.

-- SvenDowideit - 10 Mar 2012

 
Topic revision: r21 - 11 Apr 2012, GeorgeClark - This page was cached on 10 Jul 2018 - 12:40.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy