-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tres Seaver wrote:

> I have reproduced the problem:  the attached patch should fix it.
> Please report the problem to the CMF launchpad:
> 
>   https://launchpad.net/zope-cmf/+filebug
> 
> If it works for you, go ahead and attach the patch (made against the 2.1
> branch).

Hmm, I could swear I attached that file.



Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHdTtC+gerLs4ltQ4RAi4sAJ9HiqzGDsj1+T3z63FS9wLGRTxpCQCdH35a
+1NieQ9HBdzwZ10y0tiUkJU=
=tRzv
-----END PGP SIGNATURE-----
Index: CMFDefault/File.py
===================================================================
--- CMFDefault/File.py	(revision 81532)
+++ CMFDefault/File.py	(working copy)
@@ -76,6 +76,19 @@
     # can span ZODB objects.
     self._getOb(id).manage_upload(file)
 
+#
+#   Fix up PortalContent's over-generalization (OFS.Image.File has
+#   a *method* 'manage_edit', which is supposed to be POSTed to from its
+#   template, 'manage_editForm'.
+#
+manage_options = []
+for mapping in PortalContent.manage_options:
+    mapping = mapping.copy()
+    if mapping['label'] == 'Edit':
+        mapping['action'] = 'manage_editForm'
+    manage_options.append(mapping)
+manage_options.extend(Cacheable.manage_options)
+manage_options = tuple(manage_options)
 
 class File(PortalContent, OFS.Image.File, DefaultDublinCoreImpl):
 
@@ -90,9 +103,7 @@
     effective_date = expiration_date = None
     icon = PortalContent.icon
 
-    manage_options = ( PortalContent.manage_options
-                     + Cacheable.manage_options
-                     )
+    manage_options = manage_options
 
     security = ClassSecurityInfo()
 
Index: CMFDefault/Image.py
===================================================================
--- CMFDefault/Image.py	(revision 81532)
+++ CMFDefault/Image.py	(working copy)
@@ -75,6 +75,21 @@
     self._getOb(id).manage_upload(file)
 
 
+#
+#   Fix up PortalContent's over-generalization (OFS.Image.File has
+#   a *method* 'manage_edit', which is supposed to be POSTed to from its
+#   template, 'manage_editForm'.
+#
+manage_options = []
+for mapping in PortalContent.manage_options:
+    mapping = mapping.copy()
+    if mapping['label'] == 'Edit':
+        mapping['action'] = 'manage_editForm'
+    manage_options.append(mapping)
+manage_options.extend(Cacheable.manage_options)
+manage_options = tuple(manage_options)
+
+
 class Image(PortalContent, OFS.Image.Image, DefaultDublinCoreImpl):
 
     """A Portal-managed Image.
@@ -88,9 +103,7 @@
     effective_date = expiration_date = None
     icon = PortalContent.icon
 
-    manage_options = ( PortalContent.manage_options
-                     + Cacheable.manage_options
-                     )
+    manage_options = manage_options
 
     security = ClassSecurityInfo()
 
_______________________________________________
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests

Reply via email to