[Zope-DB] Fixed a problem with database test connections

Sparky sparky@emergence.com
Fri, 13 Sep 2002 16:26:10 -0600


I don't know if anyone has been experiencing this problem, but we've
noticed the following problem for many versions of Zope now (back to 2.2
or so);

When you run a query against the test tab of a database connection which
yields more than the max size of displayable results (50 in previous
Zope versions, 20 in version 2.5) a link is provided reading "(Next 20
results)" which is broken because the original query is not included in
the href. This is the result of a file called customDefaultReport.dtml
which lives in /lib/python/Shared/DC/ZRDB/dtml and in particular with
the following paragraph which generates the initial "next" link
(starting at line 28):

         <a href="<dtml-var URL><dtml-var sequence-query
            >query_start=<dtml-var
            next-sequence-start-number>">
         (Next <dtml-var next-sequence-size> results)
         </a>

If you change this to read:

         <a href="<dtml-var URL>?query_start=<dtml-var
            next-sequence-start-number>&query=<dtml-var query
url_quote_plus>">
         (Next <dtml-var next-sequence-size> results)
         </a>

then both the "previous" and "next" links will work just fine.

Once again I don't know if anyone else has even been experiencing this
problem, but I suspect it's universal regardless of which platform
you're running Zope on because the initial form that appears at
manage_testForm is submitted via post not get, and the query doesn't
exist in the URL to be carried on after the initial manage_test results
page.

If anyone knows who I can submit this change to, it would be nice to see
this fixed in future Zope versions...

--
sparky
developer
emergence by design
phone (780) 413-6397
toll free 1-866-860-2666
http://www.emergence.com