Url computation of a Five resource located in a directory resource fails

Bug #669649 reported by Sylvain Viollon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Low
Unassigned

Bug Description

If you ask via __call__() the URL of a resource on a Five resource located in a directory resource, you obtain a URL valid only for Zope 3:

http://localhost/manfred/@@/five.grok.ftests.view/style.css

(The @@ are not implemented in Zope 2, http://localhost/manfred//++resource++five.grok.ftests.view/style.css is the expected result).

This result can only be obtained if you setup a local site somewhere in the context parent list, otherwise you get an error that there is not enough information to compute the URL (this could been seen as a bug in zope.browserresource).

After looking a bit, this error comes from a lack of support in the __call__ method in the class Products.Five.resource.Resource: there is a getMultiAdapter with the resource's parent to get an AbsoluteURL adapter, that actually return a specific adapter for resource in the case where the parent is a DirectoryResource (implemented in zope.browserresource, registered for IResource).

Revision history for this message
Hanno Schlichting (hannosch) wrote :

Indeed. Until very recently subdirectories in resource directories weren't supported at all inside Zope2. In the latest Zope 2.12 versions they should no longer throw errors but might still not work in full

Changed in zope2:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Sylvain Viollon (thefunny) wrote :

I used that same five.grok code in Zope 2.12 (and I think 2.11), and it used to work correctly (in exporting resources directories and computing URLs for those resources). It is the change to zope.browserresources which broken it, as it work differently than the previous implementation.

Revision history for this message
Colin Watson (cjwatson) wrote :

The zope2 project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope2.

Changed in zope2:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.