-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dennis Allison wrote: > Sorry for the long message, but there's a lot of context. I've tried > to factor the problem out and then provide supporting stuff for the > interested. Zope 2.7.6, Python 2.4.1 (Python 2.3.5 behaves in the same > fashion). > > In summary, the problem is that a query run as a test from the ZMI of > the form > > select * from <dtml-var udb>.tablename > > fails on the second batch whereas > > select * from foo.tablename > > works fine for all batches. > > > The relevant Zope code distributed with Zope 2.7.6-final had a bug in > it which was discussed earlier on the list. The distributed code did > not terminate batching properly. The problematic code was in > > /home/allison/Zope-2.7.6-final/lib/python/Shared/DC/ZRDB/dtml > > and the fix was to patch the two link expressions to have a missing > element, that is, > > <a href="&dtml-URL;?query_start=&dtml-next-sequence-start-number; \ > &query=<dtml-var query url_quote missing="">"> > > which seemed to resolve the problem. > > BUT, there is now a second problem. When the query is dynamic, the > second batch fails on a key error -- for the example above, it would > fail with a > > >>Z SQL Method at /testfolder/batchcheck External Editor >> >>Help! >>Error, exceptions.KeyError: 'udb' SQL used: >> >>Could not render the query template! > > > message in the ZMI. However, REQUEST has the proper value for the key > according to the Error Log: > > form > query "''" > query_start '21' > > other > n_ 5 > a_ 0 > > > It's pretty clear that the query is being passed as an empty string due > to the key error. Presumably the query should be rendered and saved in > a persistent manner throughout the batching process. It is not clear > to me where this should be done. Any help in localizing and fixing the > problem would be appreciated.
Note that the missing key in your case is 'udb', while in the older case it was 'query'. I don't know where the first page was getting its value for 'udb'; there is no key for it in the error log entry you cite. >>Error Type: KeyError >>Error Value: 'query' Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 [EMAIL PROTECTED] Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDSG7B+gerLs4ltQ4RAjNlAJ0YaJL4WYWWplyAm3j+godYePWDeACgtcmH bTmMvGeXUpg9sFZTVd2Vrb4= =QSIr -----END PGP SIGNATURE----- _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )