five.localsitemanager doesn't work when explicit 'context' arguments are used in utility lookup

Bug #223872 reported by Rob Miller
4
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Low
Unassigned

Bug Description

Local utility lookup fails when the context argument is used to specify a lookup context that is different from the currently specified local site. Attached is a patch to localsitemanager.txt that contains failing tests that demonstrate the problem. This is using the five.localsitemanager trunk with the Zope 2.10 branch, the standard configuration for Plone 3.

I've concretely identified at least two sources of trouble:

1) Using getSiteManager(context=site) doesn't always return the right value. This is demonstrated in the test patch.

2) The five.localsitemanager.registry._wrap function makes an assumption that the registry within which the utility was found is within the acquisition chain of the current site as retrieved by getSite. This bug would be demonstrated by the test case patch, but it is currently being masked by the first issue. The fingerprint for this problem is that a getUtility call will return TypeError: ('Not enough context information to get parent' <SomeObjDefinition>) instead of either a utility or a regular component lookup error.

Revision history for this message
Rob Miller (nonsequitarian) wrote :
Revision history for this message
Tres Seaver (tseaver) wrote :

The attached file adds a (presumably) failing test, but does not include a fix.

Changed in zope2:
importance: Undecided → Low
status: New → Triaged
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: Triaged → 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.