Five: browser:view should set __name__

Bug #143857 reported by Martijn Pieters
2
Affects Status Importance Assigned to Milestone
Zope 2
Fix Released
Medium
Philipp von Weitershausen

Bug Description

In Zope3, browser:view sets __name__ on the generated class to the name of the view; after all it is a ILocation implementation. The Zope2/Five implementation of the directive omits this. However, Zope2's recordMetaData depends on either __name__ being set, or getPhysicalPath being available, so a plain Products.Five.BrowserView-based view class can never be rendered without it setting __name__ explicitly (or implementing getPhysicalPath).

Tags: bug zope
Revision history for this message
Philipp von Weitershausen (philikon) wrote :

Thanks for the report. You're right, browser:view doesn't seem to do this, though browser:page does. Perhaps you could round up a simple unit test (crafted after the ones in Five/browser/tests) and provide a fix along with it. The browser:page implementation in Five/browser/metaconfigure.py should provide enough inspiration :).

Revision history for this message
Martijn Pieters (mjpieters) wrote :

Status: Pending => Accepted

 Supporters added: philikon

Fixed on the Zope trunk:

http://svn.zope.org/?rev=73766&view=rev

and in the Five 1.5 branch:

http://svn.zope.org/?rev=73767&view=rev

and in the Five 1.4 branch:

http://svn.zope.org/?rev=73770&view=rev

and in the Five 1.3 branch:

http://svn.zope.org/?rev=73768&view=rev

I have no idea where to log the change though; Zope 2.9/2.10 changelogs?

Also, did I miss any branches of Five this needs to be merged to? I merged to 1.3 (Zope 2.9) and 1.5 (Zope 2.10) because they cover currently maintained Zope versions, and 1.4 because I pitied it not being attached to a Zope version in between. :)

Feel free to close if I'm all done, or re-assign to me with pointers.

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

I verified this change is indeed in the Five version used in current Zope 2.12+.

Changed in zope2:
status: Confirmed → Fix Released
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.