SQLConnectionIDs bug in ZSQLMethods Product

Bug #142689 reported by Jan Wijbrand Kolman
2
Affects Status Importance Assigned to Milestone
Products.ZSQLMethods
Invalid
Medium
Unassigned

Bug Description

The SQL.py module in the ZSQLMetohds Product provides a method to list all availble SQL Connections. It's purpose, or so it seems, is to return a list of tuples, where the first item in the tuple is the connection's title (if available) and the second item the connection's id.

However, in constructing the the list of tuple, a dictionary is used with the connection id for key *and* the id for value - the connection's title is never used.

I'd propose this patch:

 $ diff SQL.py SQL-patched.py
 40,42c40,44
 < if hasattr(o,'title_and_id'): o=o.title_and_id()
 < else: o=id
 < ids[id]=id
 ---
 > if hasattr(o,'title_and_id'):
 > title = o.title_and_id()
 > else:
 > title = id
 > ids[id] = title

Revision history for this message
Hanno Schlichting (hannosch) wrote :

Still true in Zope trunk.

Changed in zope2:
status: New → Confirmed
affects: zope2 → products.zsqlmethods
Revision history for this message
Jens Vagelpohl (dataflake-deactivatedaccount-deactivatedaccount) wrote :

Fix committed in http://svn.zope.org/?rev=115792&view=rev, will appear in version 2.13.3

Changed in products.zsqlmethods:
assignee: nobody → Jens Vagelpohl (dataflake)
status: Confirmed → Fix Committed
milestone: none → 2.13.3
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: Fix Committed → 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.