• 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.

Item3772: TWiki::Func::getOopsUrl() doesn't support def parameter

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine TWikiFuncDotPm Urgent Closed   minor 4.2.0

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

This is actually a limitation of the Func API: you can't use TWiki::Func::getOopsUrl() to generate an accessdenied message as this needs an extra def => 'topic_access' parameter. And this is not part of the calling interface. So infact anything in message.tmpl can't be called by a TWiki::Func::getOopsUrl().

Admitted, you are supposed to throw an access denied exception instead of creating a redirect of its own. But the current rest script does not catch exceptions and thus generates an internal server error if you throw an exception.

So there are three ways to fix this all:

  1. enhance the Func API to allow a def parameter
    • i think this is the appropriate long term solution - CC
  2. catch exceptions in the rest script and redirect to the appropriate oops url from in there
    • This is not an option, as REST code is not UI code. there is no guarantee that a REST handler will terminate with a redirect or page display. For example, an XmlHttpRequest really doesn't want to get answered with a redirect. - CC
    • you could still try ... catch exceptions in order to prevent an internal server error message and generate some sort of return message that can be processed by the caller - MD
  3. bypass the Func API in the EditRowPlugin rest handler
    • This is a stop-gap at best. - CC
I went with (3) for now.

-- TWiki:Main/MichaelDaum - 16 Mar 2007

As described above, the bug is in the Func API which doesn't give access to the whole functionality of getOopsUrl.

CC

Bigger job than i anticipated, but it's a bit cleaner now and I was able to delete another function from TWiki.pm smile

CC

Part of SVN 13287 was a deprecation of a Func API function.

How can a official API be deprecated without a release meeting decision?

This is not the first time this is pointed out. I am not saying I am against but people should have a chance to evaluate and make a qualified decision.

The following plugins are affected by the deprecation

See TWiki:Codev.DeprecateTWikiFuncGetOopsUrl for discussion.

-- TWiki:Main.KennethLavrsen - 07 Apr 2007

The solution is to deprecate getOopsUrl and use getScriptUrl instead. Documented, deprecated the getOopsUrl function and added unit test for the deprecated function.

CC

ItemTemplate
Summary TWiki::Func::getOopsUrl() doesn't support def parameter
ReportedBy TWiki:Main.MichaelDaum
Codebase

SVN Range TWiki-4.1.2, Sat, 03 Mar 2007, build 13043
AppliesTo Engine
Component TWikiFuncDotPm
Priority Urgent
CurrentState Closed
WaitingFor

Checkins TWikirev:13153 TWikirev:13287 TWikirev:13345
TargetRelease minor
ReleasedIn 4.2.0
Edit | Attach | Watch | Print version | History: r13 < r12 < r11 < r10 < r9 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r13 - 2008-01-22 - KennethLavrsen
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback