create new tag
, view all tags

Bug: getViewUrl implementation differs from specification

In Func.pm, it is stated that for getViewUrl, the first parameter (web) is taken to be the current web if empty. However, the implementation in TWiki.pm does not insert the current web, if the first parameter is not given.

This could be easily fixed by adding back in code from Beijing which accomplished this. It is not clear why this has been removed.

Test case

Test case for Dakar is attached (see GetViewUrlError).

Note that this testcase actually calls TWiki::getScriptUrl as I could not figure out how to get the plugin object initialized from the test script. But as TWiki::Func::getViewUrl just calls this function with the arguments passed, the same issue applies.


TWiki version: TWikiBetaRelease2004x10x30
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: WinXP
Web server: Apache 1.3.29
Perl version: 5.8.5
Client OS: WinXP
Web Browser: IE

-- ThomasWeigert - 26 Dec 2004

Follow up

Can you try it on DevelopBranch for us? Thanks. M.

-- MartinCleaver - 26 Dec 2004

I am not sure what you mean by "try it on DevelopBranch"? Note that somebody took that code out from the Beijing version, which makes me think that this was intentional? Maybe this was done to use less global variables?

-- ThomasWeigert - 27 Dec 2004

This is a bug that needs to be fixed since it breaks existing functionality. -- PeterThoeny - 27 Dec 2004

A potential fix (bringing the old code back) is attached... -- ThomasWeigert - 27 Dec 2004

Fix record

Fixed on DEVELOP, rev 3410, without using any global variables wink

-- CrawfordCurrie - 30 Dec 2004

This is not fixed in DEVELOP as of today (maybe somebody undid your fix)? See the test case attached.

-- ThomasWeigert - 01 May 2005

OK, getViewUrl was wrong; but your testcase was for getScriptUrl?

I added a module for Func testcases, test/unit/FuncTests

-- CrawfordCurrie - 02 May 2005

Yes, as I explained, I could not figure out how to write this test case for Func code. Somehow one has to instantiate a Plugin object as getViewUrl is invoked via that one. I would be greatly obliged if you could teach me how to write the same test case as attached for invoking getViewUrl.

I figured this test case would be ok as this is just a pass through to getScriptUrl....

-- ThomasWeigert - 02 May 2005

See test/unit/FuncTests.pm - I already wrote the testcase. When writing testcases it's important not to assume any implementation details beyond those that are absolutely necessary to set up the test fixture, so I called the Func interface methods as per their documentation, and not as per their old implementation.

-- CrawfordCurrie - 03 May 2005

Thanks. That test script was very illustrative for how to use the Func API....

-- ThomasWeigert - 03 May 2005

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatEXT GetViewUrlError r1 manage 1.2 K 2005-05-01 - 20:49 ThomasWeigert Dakar Testcase
Unknown file formatdiff TWiki.pm.diff r1 manage 1.1 K 2004-12-27 - 13:07 ThomasWeigert Fix
Edit | Attach | Watch | Print version | History: r12 < r11 < r10 < r9 < r8 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r12 - 2005-05-03 - ThomasWeigert
  • 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-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.