6.0.0-git
2021-01-18

[#9323] Searching for groups with non ascii chars
Summary Searching for groups with non ascii chars
Queue Horde Framework Packages
Queue Version FRAMEWORK_3
Type Bug
State Resolved
Priority 1. Low
Owners jan (at) horde (dot) org
Requester sebastian.radish (at) gmx (dot) de
Created 2010-10-20 (3743 days ago)
Due
Updated 2010-10-21 (3742 days ago)
Assigned 2010-10-21 (3742 days ago)
Resolved 2010-10-21 (3742 days ago)
Milestone
Patch No

History
2010-10-21 20:05:09 Jan Schneider Comment #6
State ⇒ Resolved
Reply to this comment
Thanks!
2010-10-21 20:02:47 CVS Commit Comment #5 Reply to this comment
Changes have been made in CVS for this ticket:

Need charset conversion here too (Bug #9323).
http://cvs.horde.org/diff.php/framework/DataTree/DataTree/sql.php?rt=horde&r1=1.156.2.45&r2=1.156.2.46&ty=u
2010-10-21 17:10:53 sebastian (dot) radish (at) gmx (dot) de Comment #4 Reply to this comment
->exists($group) is now working.

Unfortunatly, ->getGroupId($group) also failed till I added a similar 
line to the "_getId" function.

My diff looks like this know:
----------------------------------------------
--- a/horde/lib/Horde/DataTree/sql.php  2010-04-28 15:39:38.000000000 +0200
+++ b/horde/lib/Horde/DataTree/sql.php  2010-10-21 19:05:31.000000000 +0200
@@ -391,6 +391,7 @@
          $query = 'SELECT datatree_id FROM ' . $this->_params['table'] .
              ' WHERE group_uid = ? AND datatree_name = ? AND 
datatree_parents = ?';

+        $object_name = String::convertCharset($object_name, 
NLS::getCharset(), $this->_params['charset']);
          $object_names = explode(':', $object_name);
          $object_parents = '';
          foreach ($object_names as $name) {
@@ -422,6 +423,7 @@
              . ' AND datatree_parents = ?';

          $ids = array();
+        $name = String::convertCharset($name, NLS::getCharset(), 
$this->_params['charset']);
          $parts = explode(':', $name);
          foreach ($parts as $part) {
              $result = $this->_db->getOne($query, 
array($this->_params['group'], $part, count($ids) ? ':' . implode(':', 
$ids) : ''));
2010-10-21 10:35:41 Jan Schneider Comment #3
Assigned to Jan Schneider
State ⇒ Feedback
Reply to this comment
Try this?
2010-10-21 10:35:10 CVS Commit Comment #2 Reply to this comment
Changes have been made in CVS for this ticket:

Convert charset when checking for existance (Bug #9323).
http://cvs.horde.org/diff.php/framework/DataTree/DataTree/sql.php?rt=horde&r1=1.156.2.44&r2=1.156.2.45&ty=u
2010-10-20 15:04:00 sebastian (dot) radish (at) gmx (dot) de Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ Searching for groups with non ascii chars
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
Reply to this comment
I'm writing my own module vor Horde (currently 3.3.8)

I'm using a MySQL database (charset is set to utf-8). The group system 
uses the DataTree backend.

I want to try if a group (with non ascii chars) exists with something 
like this:
Group::singleton()->exits($group);
However, if the groups are not cached, it only works if I do this first:
$group = String::convertCharset($group, 
$GLOBALS['_HORDE_STRING_CHARSET'], 'utf-8');

$GLOBALS['_HORDE_STRING_CHARSET'] seems to be 'iso8859-1'.

Saved Queries