Batching in ZSQLMethod test is broken

Bug #143585 reported by Bug Importer
0
Affects Status Importance Assigned to Milestone
Products.ZSQLMethods
Invalid
Low
Unassigned

Bug Description

When using "Test" tab for ZSQLMethod which has some parameters
only first 20 results are shown correctly.
'(Next 20 results)' link is broken. It leads to page that says:

Error, exceptions.NameError: name 'param_name' is not defined
SQL used:
Could not render the query template!

This is because of not passing query parameters in the '(Next 20 results)' link. There is additional, unnecessary 'query' parameter in this link that is always empty:

http://host:8080/folder/my_method/manage_test?query_start=21&query=''

Tags: bug zope
Revision history for this message
Victor Safronovich (suvit) wrote :

the parameter 'query' is not empty, it equals to "''".

Revision history for this message
Maciej Wisniowski (pigletto) wrote :

Uploaded: ZSQLTestHotfix.tar.gz

I've found that changing two lines in file:
[ZOPE_HOME]/lib/python/Shared/DC/ZRDB/dtml/customDefaultReport.dtml

from:
<a href="&dtml-URL;?query_start=&dtml-previous-sequence-start-number;&query=<dtml-var query url_quote missing=''>">
(...)
<a href="&dtml-URL;?query_start=&dtml-next-sequence-start-number;&query=<dtml-var query url_quote missing=''>">

to:
<a href="&dtml-URL;<dtml-var sequence-query missing=''>query_start=&dtml-previous-sequence-start-number;">
(...)
<a href="&dtml-URL;<dtml-var sequence-query missing=''>query_start=&dtml-next-sequence-start-number;">

seems to solve this problem.

Revision history for this message
Victor Safronovich (suvit) wrote :

using missing='' is wrong, because it renders as "''", but missing="" renders as empty string ""

affects: zope2 → products.zsqlmethods
Changed in products.zsqlmethods:
status: New → Confirmed
Revision history for this message
Colin Watson (cjwatson) wrote :

The products.zsqlmethods project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/products.zsqlmethods.

Changed in products.zsqlmethods:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.