6.0.0-alpha14
7/3/25

[#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 10/20/2010 (5370 days ago)
Due
Updated 10/21/2010 (5369 days ago)
Assigned 10/21/2010 (5369 days ago)
Resolved 10/21/2010 (5369 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
10/21/2010 08:05:09 PM Jan Schneider Comment #6
State ⇒ Resolved
Reply to this comment
Thanks!
10/21/2010 08:02:47 PM 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
10/21/2010 05:10:53 PM 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) : ''));
10/21/2010 10:35:41 AM Jan Schneider Comment #3
State ⇒ Feedback
Assigned to Jan Schneider
Reply to this comment
Try this?
10/21/2010 10:35:10 AM 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
10/20/2010 03:04:00 PM sebastian (dot) radish (at) gmx (dot) de Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Searching for groups with non ascii chars
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
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