Item10581: location of rsrc directory has changed and is not being reflected in the rewritten html
Priority: Urgent
Current State: Closed
Released In: n/a
Target Release: major
Version 2.20.
Under earlier versions of the plugin a
rsrc
directory was written into the directory for each web. For example, here's what
the layout looked like relative to
$Foswiki::cfg{PublishPlugin}{Dir}
Web1
Web1/rsrc
Web2
Web2/rsrc
The links to the contents of the
rsrc
directory were rewritten in the HTML as a relative URL, e.g.
@import url('rsrc/System/SkinTemplates/base.css'
Version 2.20 has collapsed the multiple rsrc directories into one, so
that they are now
rsrc
Web1
Web2
The links are still written assuming the old directory layout (as
rsrc
rather than as e.g.
../rsrc
) and thus are failing. Published subwebs (which don't work in 2.20 for other reasons, another bug report is forthcoming) are even more estranged from the
rsrc
directory.
On a different note, while collapsing the
rsrc
directories into one will save space, it makes it difficult to create a top-level site based on a single web. For example, in one current configuration, I have a web whose published version is exposed directly at the top level of the site (e.g.,
http::/my.site.org/
maps onto
Web1
in the above example). If the
rsrc
directory is at the same level as
Web1
it's effectively outside of the Apache
DocumentRoot.
On this site I don't have the authority to configure the server to alias the
rsrc
URL appropriately; I can only drop files into the directory I'm given, which is at the top level. The new behavior breaks this configuration.
--
DiabJerius - 31 Mar 2011
I've attached a draft patch which fixes up most of the behavior by rewriting the paths to the resources relative to the top level rsrc directory. I don't think it's a complete solution.
--
DiabJerius - 03 Apr 2011
patch modified to ensure that the path to a resource is modified only once.
--
DiabJerius - 04 Apr 2011
I've settled on another approach: adding a
rsrcdir
option which allows the user to specify its location relative to the top of the site; this allows one to locate it within one of the output web directories to get a self contained directory. E.g., if I'm publishing
Public
, setting
rsrcdir
to
Public/rsrc
creates it as a subdirectory of the output
Public
directory.
patch attached
--
DiabJerius - 05 Apr 2011
A think I understand what you are doing, but the patch is against an old codebase and i can't work out how to merge it. Can you either check in the fix, or give me a patch against the latest code? Thanks.
crap, I worked it out. My bad.
--
CrawfordCurrie - 25 May 2011