Permalink
Browse files

Merge branch 'master' of https://github.com/collective/eea.sparql

  • Loading branch information...
2 parents 1a5aeda + 4ccbd84 commit ec955cdb3311b33dcc2aec74afcdb7d7861dd837 @avoinea avoinea committed Jan 31, 2013
Showing with 9 additions and 1 deletion.
  1. +2 −0 docs/HISTORY.txt
  2. +7 −1 eea/sparql/browser/sparql.py
View
@@ -5,6 +5,8 @@ Changelog
----------------------
* Upgrade step: Within "Plone > Site setup > Add-ons" click on
upgrade button available for eea.sparql.
+* Bug fix: Fixed preview for queries returning empty fields
+ [szabozo0 refs #9608]
* Feature: Added quick preview for sparql queries
[szabozo0 refs #9608]
* Feature: Data persistence and versioning
@@ -332,6 +332,9 @@ class QuickPreview(BrowserView):
def preview(self):
"""preview"""
tmp_query = self.request.get("sparql_query", "")
+ tmp_query = "\n".join(x for x in tmp_query.splitlines()
+ if not x.strip().startswith("#"))
+
tmp_arg_spec = self.request.get("arg_spec", "")
tmp_endpoint = self.request.get("endpoint", "")
tmp_timeout = int(self.request.get("timeout", "0"))
@@ -375,7 +378,10 @@ def preview(self):
for row in data.get('rows', []):
result.append(u"<tr class='row_0'>")
for value in row:
- result.append(u"<td> %s </td>" %cgi.escape(value.n3()))
+ try:
+ result.append(u"<td> %s </td>" %cgi.escape(value.n3()))
+ except Exception, err:
+ result.append(u"<td> %s </td>" %value)
result.append(u"</tr>")
result.append(u"</tbody>")
result.append(u"</table>")

0 comments on commit ec955cd

Please sign in to comment.