Foswiki on GitHub is open for business! Next release meeting: Monday September 15, 1300Z

Item297: viewfile can't be used as a dropin replacement for {pubUrl}, and when viewfile fails it redirects to an oops mess

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Urgent Closed Engine    
viewfile is broken

  • http://foswiki.org/bin/viewfile/Tasks/WebPreferences?filename=moderntimes.jpg works

but what needs to work is to have PUBURL set to SCRIPTURL{viewfile} - ie
  • http://foswiki.org/bin/viewfile/Tasks/WebPreferences/moderntimes.jpg

and this is terminally busted, redirecting to
  • http://foswiki.org/bin/oops/Tasks/WebPreferences/moderntimes/Jpg?template=oopsattention;def=no_such_attachment;param1=viewfile;param2=moderntimes.jpg;template=oopsattention;def=no_such_attachment;param1=viewfile;param2=moderntimes.jpg

which makes no sense at all for what should be a 404, unless the user happens to be showing just that url.

the fact it redirects is really painful too - see the oops bug Crawford put in.

if it did work this way, we could set pubUrl to use viewfile, and then use an apache rewrite to go directly to the file url for the System web. (for eg).


It seems that this problem is the same as Item5967, that was fixed (I can't check now in what branch it was fixed).

yeah, you and I wish it were, but the change in trunk : see the link to trac in the Task, didn't address the bug, so I'm thinking it was a partial fix. I'm also not really happy about the location of the change.

I am planning on writing a bucket of tests, cos my commit doesn't fill me with confidence either.
  1. need to test nested webs,
  2. need to make sure the web&topic is correct
  3. need to make sure that is works out non topic paths - such as System/DojoToolKitContrib/A/long/file/path/to/Some.css
  4. and that with all these variations that the topic ACL's are respected.

given that Rob and I failed to test either of our fixes with enough variations - it must be automated. (ew)

Sven

ok, many tests added, and a working fix applied

-- SvenDowideit - 27 Nov 2008

ItemTemplate edit

Summary viewfile can't be used as a dropin replacement for {pubUrl}, and when viewfile fails it redirects to an oops mess
ReportedBy TWiki:Main.SvenDowideit
Codebase trunk
SVN Range TWiki-4.2.3, Wed, 06 Aug 2008, build 17396
AppliesTo Engine
Component
Priority Urgent
CurrentState Closed
WaitingFor
Checkins Foswikirev:935
TargetRelease patch
ReleasedIn 1.0.0
Topic revision: r7 - 08 Jan 2009, KwangErnLiew
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License