zopefoundation / Products.ZSQLMethods

SQL method support for Zope.
Other
3 stars 14 forks source link

Adding Z Search Interface generates Internal Server Error #46

Closed wlang42 closed 8 months ago

wlang42 commented 8 months ago

BUG/PROBLEM REPORT / FEATURE REQUEST

What I did:

zsearch-02

zsearch-03

What I expect to happen:

What actually happened:

zsearch-04

What version of Python and Zope/Addons I am using:

Zope-5.9 Python-3.9.5 Products.ZSQLMethods-4.0

Additional Info:

2023-12-30 21:09:37,860 ERROR   [waitress:435][waitress-0]
 Exception while serving /VirtualHostBase/https/bach.wu.ac.at:443/VirtualHostRoot/_vh_zope4/_vh_prod2/wlang/manage_addProduct/ZSQLMethods/manage_addZSearch
Traceback (most recent call last):
  File "/opt/wu-wien/zope/buildouts/z5-dev-wl/eggs/waitress-2.1.2-py3.9.egg/waitress/channel.py", line 428, in service
    task.service()
  File "/opt/wu-wien/zope/buildouts/z5-dev-wl/eggs/waitress-2.1.2-py3.9.egg/waitress/task.py", line 168, in service
    self.execute()
  File "/opt/wu-wien/zope/buildouts/z5-dev-wl/eggs/waitress-2.1.2-py3.9.egg/waitress/task.py", line 434, in execute
    app_iter = self.channel.server.application(environ, start_response)
  File "/opt/wu-wien/zope/buildouts/z5-dev-wl/eggs/Paste-3.7.1-py3.9.egg/paste/translogger.py", line 77, in __call__
    return self.application(environ, replacement_start_response)
  File "/opt/wu-wien/zope/buildouts/z5-dev-wl/eggs/Zope-5.9-py3.9.egg/ZPublisher/httpexceptions.py", line 30, in __call__
    return self.application(environ, start_response)
  File "/opt/wu-wien/zope/buildouts/z5-dev-wl/eggs/Zope-5.9-py3.9.egg/ZPublisher/WSGIPublisher.py", line 391, in publish_module
    response = _publish(request, new_mod_info)
  File "/opt/wu-wien/zope/buildouts/z5-dev-wl/eggs/Zope-5.9-py3.9.egg/ZPublisher/WSGIPublisher.py", line 285, in publish
    result = mapply(obj,
  File "/opt/wu-wien/zope/buildouts/z5-dev-wl/eggs/Zope-5.9-py3.9.egg/ZPublisher/mapply.py", line 98, in mapply
    return debug(object, args, context)
  File "/opt/wu-wien/zope/buildouts/z5-dev-wl/eggs/Zope-5.9-py3.9.egg/ZPublisher/WSGIPublisher.py", line 68, in call_object
    return obj(*args)
  File "/opt/wu-wien/zope/buildouts/z5-dev-wl/develop-source/Products.ZSQLMethods/src/Shared/DC/ZRDB/Search.py", line 63, in manage_addZSearch
    raise ValueError(
ValueError: The input searchable object, <em>fullname_sql</em>,
                has not been tested.  Until it has been tested,
                it's output schema is unknown, and a report
                cannot be generated.  Before creating a report
                from this query, you must try out the query.  To
                try out the query, <a href="https://.../fullname_sql">click here</a>.
wlang42 commented 8 months ago

There a two things with that:

Addressing the second point: The Search Interface needs the _col Attribute of the searchable object (ie ZSQL Method), which is assumed to be created when using the "Test" tab for it.

But, the "Test" tab does not create the _col attribute anymore.

It is created only, if the Shared.DC.ZRDB.DA.DA.__call__ method is called with the test__ argument set to a True like value. But thats currently not the case when called from DA.manage_zmi_test.