UtilityRegistration Fails due to AdapterRegistration

Bug #183320 reported by kevingill
2
Affects Status Importance Assigned to Milestone
Zope 3
Won't Fix
Undecided
Unassigned
zope.app.component
New
Undecided
Unassigned

Bug Description

In zope.app.component

In the SiteManager, you can register Adapters and Utilities.

The default registration.html, (implemented in browser/registration.py) does not handle the case where an object may have an adapter registration.

The offending code is in RegistrationView.registrations:

     registrations = [
           component.getMultiAdapter((r, self.request), IRegistrationDisplay)
           for r in sorted(_registrations(self.context, self.context))
           ]

The result from _registrations may contain classes which do not have an IRegistrationDisplay adapter registered.

The following code resolves the problem:

     registrations = [
            component.getMultiAdapter((r, self.request), IRegistrationDisplay)
            for r in sorted(_registrations(self.context, self.context))
            if zope.component.interfaces.IUtilityRegistration.providedBy(r)
            ]

The resulting exception causes the registration.html view to fail to display after Adapter Registrations are made for a utility.

Changed in zope3:
status: New → Won't Fix
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.