[ZCM] [ZC] 819/ 1 Request "No id returned after import"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin@zope.org
Fri, 21 Feb 2003 19:42:39 -0500


Issue #819 Update (Request) "No id returned after import"
 Status Pending, Zope/bug+solution low
To followup, visit:
  http://collector.zope.org/Zope/819

==============================================================
= Request - Entry #1 by Anonymous User on Feb 21, 2003 7:42 pm

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'.
==============================================================