Suddenly I cannot add new objects
I have a zClass 'maal' with the following properties: title string language "dk uk" selection format string description text The system has been running for a while now, and it has worked nicely. Probably I have made some changes that has subtely destroyed something, or it is some kind of problem with Catalog. I can still read all the 'maal' objects that I have added earlier, but I cannot add new ones. When I try to add it to another objecManager zClass I have made I get the following traceback: ----------------------------------------------------------- Live system: Zope Version Zope 2.3.1 (binary release, python 1.5.2, linux2-x86) Python Version 1.5.2 (#10, Dec 6 1999, 12:16:27) [GCC 2.7.2.3] System Platform linux2 and Development: Zope Version Zope 2.3.2 (binary release, python 1.5.2, win32-x86) Python Version 1.5.2 (#0, Jul 30 1999, 09:52:18) [MSC 32 bit (Intel)] System Platform win32 ----------------------------------------------------------- Error Type: KeyError Error Value: description --- Traceback (innermost last): File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: RoleManager) File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: maal_add) File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: maal_add) File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/OFS/DTMLMethod.py, line 189, in __call__ (Object: maal_add) File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/DocumentTemplate/DT_String. py, line 538, in __call__ (Object: maal_add) File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/DocumentTemplate/DT_With.py , line 133, in render (Object: maal.createInObjectManager(REQUEST['id'], REQUEST)) File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/DocumentTemplate/DT_Util.py , line 334, in eval (Object: maal.createInObjectManager(REQUEST['id'], REQUEST)) (Info: REQUEST) File <string>, line 0, in ? File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/ZClasses/ZClass.py, line 535, in createInObjectManager (Object: maal) File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/OFS/ObjectManager.py, line 302, in _setObject (Object: CatalogAware) File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/Products/ZCatalog/CatalogAw areness.py, line 114, in manage_afterAdd (Object: CatalogAware) File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/Products/ZCatalog/CatalogAw areness.py, line 184, in index_object (Object: CatalogAware) File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/Products/ZCatalog/ZCatalog. py, line 429, in catalog_object (Object: Traversable) File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/Products/ZCatalog/Catalog.p y, line 448, in catalogObject File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/SearchIndex/UnTextIndex.py, line 323, in index_object File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/OFS/DTMLMethod.py, line 182, in __call__ (Object: PrincipiaSearchSource) File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/DocumentTemplate/DT_String. py, line 538, in __call__ (Object: PrincipiaSearchSource) File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/DocumentTemplate/DT_Return. py, line 104, in render (Object: description) KeyError: (see above)
=?iso-8859-1?Q?Max=5FM=F8ller=5FRasmussen?= writes:
I have a zClass 'maal' with the following properties:
title string language "dk uk" selection format string description text
The system has been running for a while now, and it has worked nicely. Probably I have made some changes that has subtely destroyed something, or it is some kind of problem with Catalog.
I can still read all the 'maal' objects that I have added earlier, but I cannot add new ones.
When I try to add it to another objecManager zClass I have made I get the following traceback: ....
(Object: PrincipiaSearchSource)
File /usr/local/zope/Zope-2.3.1-linux2-x86/lib/python/DocumentTemplate/DT_Return. py, line 104, in render
(Object: description)
KeyError: (see above) When you configure a ZCatalog index, you can use the name of a parameterless method. This method is then called during indexing to obtain the base value used to index.
The method must not be a DTML method! The indexing process calls the method without parameters and DTML methods lose all their context in this case. Apparently, you use a DTML method in this way. It can no longer access "description", as it lost all context information. Dieter
Well Dieter ... you are my hero ;-)
(Object: PrincipiaSearchSource)
The method must not be a DTML method! The indexing process calls the method without parameters and DTML methods lose all their context in this case.
You where absolutely right! I had a dtml-method called PrincipiaSearchSource in the "maal" object. And I remember putting it there months ago when learning the zCatalog. Later I moved it to an external method, as well it should be. But apparently I had forgotten to delete the dtml method, and people has been using the site without adding this particular object. So it went on unnoticed for months. An naturally I had stared myself blind on it. But thanks again. Regards Max M Max M. W. Rasmussen, Denmark. New Media Director private: maxmcorp@worldonline.dk work: maxm@normik.dk ----------------------------------------------------- Shipping software is an unnatural act
participants (3)
-
Dieter Maurer -
Max M -
Max Møller Rasmussen