Public bug reported:

I noticed another problem in in-widget SQL that occurs if two columns in
a single row result set have the same value.

Let's say our main SQL query is:

select name, group_level from aiki_users_groups

And the content is:

((name))

(sql(SELECT username as theuser, full_name as thename FROM aiki_users
WHERE usergroup = '((group_level))' AND email != '' ORDER BY
username||[-[theuser]-] [-[thename]=])sql)

BTW, I'm using SELECT AS here because unfortunately [-[username]-] seems
to first evaluate to [username], meaning the username of the currently
logged in user is displayed.

In any case, the results will be as expected for every row, UNLESS by
some coincidence the user's username and full_name have the same value.

So if our results set is:

theuser | thename
-------------------------
user1 | The First User
user2 | user2

then the output will be:

user1 The First User
[-[theuser]-]  user2

The first variable never gets replaced if the value of the two variable
is the same.

** Affects: aikiframework
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Aiki
Framework Admins, which is subscribed to aikiframework.
https://bugs.launchpad.net/bugs/772874

Title:
  In-widget SQL prints out variable if more than one result in single
  row have the same value

Status in Aiki Framework:
  New

Bug description:
  I noticed another problem in in-widget SQL that occurs if two columns
  in a single row result set have the same value.

  Let's say our main SQL query is:

  select name, group_level from aiki_users_groups

  And the content is:

  ((name))

  (sql(SELECT username as theuser, full_name as thename FROM aiki_users
  WHERE usergroup = '((group_level))' AND email != '' ORDER BY
  username||[-[theuser]-] [-[thename]=])sql)

  BTW, I'm using SELECT AS here because unfortunately [-[username]-]
  seems to first evaluate to [username], meaning the username of the
  currently logged in user is displayed.

  In any case, the results will be as expected for every row, UNLESS by
  some coincidence the user's username and full_name have the same
  value.

  So if our results set is:

  theuser | thename
  -------------------------
  user1 | The First User
  user2 | user2

  then the output will be:

  user1 The First User
  [-[theuser]-]  user2

  The first variable never gets replaced if the value of the two
  variable is the same.

_______________________________________________
Mailing list: https://launchpad.net/~aikiframework.admins
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework.admins
More help   : https://help.launchpad.net/ListHelp

Reply via email to