[Zope-CMF] Small bug with favorites
Florent Guillaume
fg@nuxeo.com
7 Nov 2001 18:08:06 GMT
If you add a favorite at the root of the portal (like all newbies are
wont to do), the actually created favorite points to the Favorites
folder itself.
This is basically due to the fact that restrictedTraverse('') returns
the current object.
Patch (also in tracker as http://www.zope.org/Products/PTK/Tracker/402) :
--- Favorite.py 10 Aug 2001 18:52:44 -0000 1.9
+++ Favorite.py 7 Nov 2001 17:56:40 -0000
@@ -130,7 +130,7 @@
Add a Favorite
"""
portal_url = getToolByName(self, 'portal_url')
- relUrl = portal_url.getRelativeUrl(self.restrictedTraverse(
+ relUrl = portal_url.getRelativeUrl(portal_url.getPortalObject().restrictedTraverse(
remote_url))
o=Favorite( id, title, relUrl, description )
self._setObject(id,o)
-- Florent
--
Florent Guillaume, Nuxeo SARL (Paris, France)
+33 1 40 33 79 10 http://nuxeo.com mailto:fg@nuxeo.com