[Zope-CMF] Re: Properties tab for files missing in ZMI - CMF

2007-12-28 Thread Tres Seaver
-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


[Zope-CMF] Re: Properties tab for files missing in ZMI - CMF

2007-12-28 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

roel wrote:
> Hello there,
> 
> first of all, I hereby present to all of you my best wishes for 2008.
> 
> That said, I have problems accessing the properties of file objects (pdf,
> images, ... ) added to a CMF site. All I get is the 'Dublin Core' page. When I
> hit the 'Edit' tab, I get errors like:
> 
> Traceback (innermost last):
>   Module ZPublisher.Publish, line 119, in publish
>   Module ZPublisher.mapply, line 83, in mapply
>   Module ZPublisher.Publish, line 47, in missing_name
>   Module ZPublisher.HTTPResponse, line 694, in badRequestError
> 
> There seems to be missing (meta)data, but I have no (direct) way to edit these
> entries.
> I got to the point where I can access these properties by creating a custom
> url out of the location-url/filename/manage_propertiesForm and pasting this in
> a browser.
> 
> In the early days (Zope 2.5.1 & CMF 1.3) there was a 'Properties' tab when
> accessing a file object in a CMF site trough the ZMI. We've recently installed
> Zope 2.10.4 & CMF 2.1.0. When I create a file object outside a CMF site, the
> 'Properties' tab is displayed as I'm used to ...
> 
> How can I (re)enable the 'Properties' tab for files in CMF 2.1.0?

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).



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

iD8DBQFHdSh8+gerLs4ltQ4RAjCMAKCAh6OkaW522fTVg/k2mQq2CjLAhACfcxTD
6FE1dFjEbFvPFa0P2wV9rts=
=Kt59
-END PGP SIGNATURE-

___
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