[Zope-Coders] Bug in import machinery (OFS/ObjectManager.py)
Florent Guillaume
fg@nuxeo.com
Mon, 17 Feb 2003 18:07:21 +0100
Please submit a bug report for this, using
http://collector.zope.org/Zope which will ensure this report does not
get buried in the traffic of mailing-lists.
Thanks,
Florent
In article <200302141448.h1EEmJd05758@s01.commissio.org> you write:
> Hi there!
>
> When working on a project I ran into a bug in Zope 2.5.1, which doesn't seem to be fixed in 2.6.1 yet as well. It concerns the following:
>
> When finished importing, the manage_importObject method on OFS.ObjectManager.py returns self.manage_main() with as arguments a formatted string telling the import has been successful, some string called 'title' and a bool 'update_menu'. The first argument is a formatted string in which 'id' is placed. This 'id' should be a string with the id of the imported object (I suppose), but in fact references to the built-in function 'id' (creating an output like '<em><built-in function id></em> successfully imported'). I think the _importObjectFromFile method (a couple of lines below manage_importObject) should return the id of the object created, and that should be formatted into the string instead. But the _importObjectFromFile method currently doesn't return the id, and the manage_importObject method doesn't get it from the call. I got the results I expected when i changed line 525 from
>
> self._importObjectFromFile(filepath, verify=not not REQUEST,
>
> to
>
> id = self._importObjectFromFile(filepath, verify=not not REQUEST,
>
> and made _importObjectFromFile 'return id'.
>
> I thought about checking the fix in myself, but after reading the CVSFAQ I decided that it would be a lot less trouble to just tell you guys here and ask whether any of you want to check it in. I reckon there must be someone out there who is currently working on his own branch already and who wouldn't mind checking in (and testing?) my fix...
>
> Anyway, I hope you don't mind me using this channel to notify you in this manner instead of just fixing the bug myself, and also that you are willing to fix it for me...
--
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87 http://nuxeo.com mailto:fg@nuxeo.com