<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Kronolith_Tagger: ensureTypes not recognizing existing types</title> 
  <pubDate>Sat, 04 Apr 2026 16:31:27 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/9223</link> 
  <atom:link rel="self" type="application/rss+xml" title="Kronolith_Tagger: ensureTypes not recognizing existing types" href="https://bugs.horde.org/ticket/9223/rss" /> 
  <description>Kronolith_Tagger: ensureTypes not recognizing existing types</description> 
 
   
   
  <item> 
   <title>A fatal error has occurred
SQLSTATE[23000]: Integrity const</title> 
   <description>A fatal error has occurred
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry &#039;calendar&#039; for key 2</description> 
   <pubDate>Sat, 04 Sep 2010 17:23:32 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59838</link> 
  </item> 
   
  <item> 
   <title>I can&#039;t duplicate this. What RDBMS are you using? Have you c</title> 
   <description>I can&#039;t duplicate this. What RDBMS are you using? Have you changed anything related to the database? Can you provide steps to reproduce?</description> 
   <pubDate>Sat, 04 Sep 2010 21:02:54 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59843</link> 
  </item> 
   
  <item> 
   <title>it seems there was an issue with the db_migrate script. afte</title> 
   <description>it seems there was an issue with the db_migrate script. after migrating down and up again. everything works fine. thx</description> 
   <pubDate>Sat, 04 Sep 2010 22:42:25 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59845</link> 
  </item> 
   
  <item> 
   <title>No luck, the error is coming again. I will try to investigat</title> 
   <description>No luck, the error is coming again. I will try to investigate</description> 
   <pubDate>Sat, 04 Sep 2010 22:48:23 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59846</link> 
  </item> 
   
  <item> 
   <title>The issue comes from the Content_Types_Manager class, Functi</title> 
   <description>The issue comes from the Content_Types_Manager class, Function ensureTypes. If I change the coding from &quot;if (is_int($type)&quot; to &quot;if (is_int($typeIndex))&quot; everything works fine. 

My database looks like this:
type_id 	type_name
1 	calendar
2 	event
</description> 
   <pubDate>Sat, 04 Sep 2010 23:06:07 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59847</link> 
  </item> 
   
  <item> 
   <title>&gt; The issue comes from the Content_Types_Manager class, Func</title> 
   <description>&gt; The issue comes from the Content_Types_Manager class, Function 
&gt; ensureTypes. If I change the coding from &quot;if (is_int($type)&quot; to &quot;if 
&gt; (is_int($typeIndex))&quot; everything works fine.

That code is incorrect and will likely corrupt your content data.

You can see what the query on line 69 returns from your DB, and compare it with what you think it should return.</description> 
   <pubDate>Sat, 04 Sep 2010 23:17:48 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59849</link> 
  </item> 
   
  <item> 
   <title>Yes, you&#039;re right. The problem is $typeName consists of name</title> 
   <description>Yes, you&#039;re right. The problem is $typeName consists of name/id, but the sql statement is returning id/name. So the unset is not working. I am using Mysql. Any idea?</description> 
   <pubDate>Sat, 04 Sep 2010 23:33:26 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59850</link> 
  </item> 
   
  <item> 
   <title>The coding seems to be even more complex. At the moment I ca</title> 
   <description>The coding seems to be even more complex. At the moment I can hardly believe this part was ever working. Can you confirm?</description> 
   <pubDate>Sun, 05 Sep 2010 00:56:02 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59852</link> 
  </item> 
   
  <item> 
   <title>as I stated earlier, I am not seeing any issues. </title> 
   <description>as I stated earlier, I am not seeing any issues. </description> 
   <pubDate>Sun, 05 Sep 2010 01:18:39 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59853</link> 
  </item> 
   
  <item> 
   <title>The db statement is returning an array. I assume this should</title> 
   <description>The db statement is returning an array. I assume this should only be a string?

Array ( [0] =&gt; calendar )
Warning: Illegal offset type in /horde/content/lib/Types/Manager.php on line 71
Warning: Illegal offset type in unset in /horde/content/lib/Types/Manager.php on line 72</description> 
   <pubDate>Sun, 05 Sep 2010 10:11:21 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59855</link> 
  </item> 
   
  <item> 
   <title>&gt; The db statement is returning an array. I assume this shou</title> 
   <description>&gt; The db statement is returning an array. I assume this should only be 
&gt; a string?

No, it should be an array, that&#039;s why it&#039;s in a foreach loop.  That&#039;s what selectAssoc() is expected to return. type_id should be the key, and type_name is the value.  So.... in the loop, $id is the type_id and $type is type_name.</description> 
   <pubDate>Sun, 05 Sep 2010 14:36:44 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59859</link> 
  </item> 
   
  <item> 
   <title>By the way, can you *please* use a real email address when r</title> 
   <description>By the way, can you *please* use a real email address when reporting bugs, devs get multiple bounce notices each time one of your tickets is updated.</description> 
   <pubDate>Sun, 05 Sep 2010 14:43:33 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59860</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; The db statement is returning an array. I assume this sho</title> 
   <description>&gt;&gt; The db statement is returning an array. I assume this should only be
&gt;&gt; a string?
&gt;
&gt; No, it should be an array, that&#039;s why it&#039;s in a foreach loop.  That&#039;s 
&gt; what selectAssoc() is expected to return. type_id should be the key, 
&gt; and type_name is the value.  So.... in the loop, $id is the type_id 
&gt; and $type is type_name.

Exactly there&#039;s the problem in the loop. Here is my debugging:
1. loop: 
$key: 0
$type: Array ( [calendar] =&gt; 1 ) 
2. loop: 
$key: 1
$type: Array ( [event] =&gt; 2 ) 

If I understand everything right, it should be:
1. loop: 
$key: 1
$type: calendar
2. loop: 
$key: 2
$type: event</description> 
   <pubDate>Sun, 05 Sep 2010 14:59:03 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59861</link> 
  </item> 
   
  <item> 
   <title>
&gt; Exactly there&#039;s the problem in the loop. Here is my debu</title> 
   <description>
&gt; Exactly there&#039;s the problem in the loop. Here is my debugging:
&gt; 1. loop:
&gt; $key: 0
&gt; $type: Array ( [calendar] =&gt; 1 )
&gt; 2. loop:
&gt; $key: 1
&gt; $type: Array ( [event] =&gt; 2 )

You are getting these values inside the foreach loop that does the db-&gt;selectAssoc() call (line 70 or so)?  That looks badly broken.  What does your table look like?</description> 
   <pubDate>Sun, 05 Sep 2010 15:33:06 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59866</link> 
  </item> 
   
  <item> 
   <title>Here&#039;s the export of my table:

CREATE TABLE `rampage_type</title> 
   <description>Here&#039;s the export of my table:

CREATE TABLE `rampage_types` (
  `type_id` int(10) unsigned NOT NULL auto_increment,
  `type_name` varchar(255) NOT NULL,
  PRIMARY KEY  (`type_id`),
  UNIQUE KEY `rampage_objects_type_name` (`type_name`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;

INSERT INTO `rampage_types` (`type_id`, `type_name`) VALUES 
(1, &#039;calendar&#039;),
(2, &#039;event&#039;);

The result of the db-statement is:
Array ( [0] =&gt; Array ( [1] =&gt; calendar ) [1] =&gt; Array ( [2] =&gt; event ) ) 
-&gt; $id=0; $type=Array ( [1] =&gt; calendar )
-&gt; $id=1; $ype=Array ( [2] =&gt; event )</description> 
   <pubDate>Sun, 05 Sep 2010 19:27:02 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59868</link> 
  </item> 
   
  <item> 
   <title>&gt; The result of the db-statement is:
&gt; Array ( [0] =&gt; Array</title> 
   <description>&gt; The result of the db-statement is:
&gt; Array ( [0] =&gt; Array ( [1] =&gt; calendar ) [1] =&gt; Array ( [2] =&gt; event ) )
&gt; -&gt; $id=0; $type=Array ( [1] =&gt; calendar )
&gt; -&gt; $id=1; $ype=Array ( [2] =&gt; event )

Sorry to belabor the point, but this is the output of:

            var_dump($this-&gt;_db-&gt;selectAssoc(&#039;SELECT type_id, type_name FROM &#039; . $this-&gt;_t(&#039;types&#039;) . &#039; WHERE type_name IN (&#039;.implode(&#039;,&#039;, array_map(array($this-&gt;_db, &#039;quote&#039;), array_keys($typeName))).&#039;)&#039;));

?

When I dump that, I (correctly) get:


array(2) { [1]=&gt;  string(8) &quot;calendar&quot; [2]=&gt;  string(5) &quot;event&quot; }</description> 
   <pubDate>Sun, 05 Sep 2010 20:08:32 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59870</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; The result of the db-statement is:
&gt;&gt; Array ( [0] =&gt; Arr</title> 
   <description>&gt;&gt; The result of the db-statement is:
&gt;&gt; Array ( [0] =&gt; Array ( [1] =&gt; calendar ) [1] =&gt; Array ( [2] =&gt; event ) )
&gt;&gt; -&gt; $id=0; $type=Array ( [1] =&gt; calendar )
&gt;&gt; -&gt; $id=1; $ype=Array ( [2] =&gt; event )
&gt;
&gt; Sorry to belabor the point, but this is the output of:
&gt;
&gt;             var_dump($this-&gt;_db-&gt;selectAssoc(&#039;SELECT type_id, 
&gt; type_name FROM &#039; . $this-&gt;_t(&#039;types&#039;) . &#039; WHERE type_name IN 
&gt; (&#039;.implode(&#039;,&#039;, array_map(array($this-&gt;_db, &#039;quote&#039;), 
&gt; array_keys($typeName))).&#039;)&#039;));
&gt;
&gt; ?
&gt;
&gt; When I dump that, I (correctly) get:
&gt;
&gt;
&gt; array(2) { [1]=&gt;  string(8) &quot;calendar&quot; [2]=&gt;  string(5) &quot;event&quot; }

Here is the dump I get. I am using mysql
array(2) { [0]=&gt;  array(1) { [1]=&gt;  string(8) &quot;calendar&quot; } [1]=&gt;  array(1) { [2]=&gt;  string(5) &quot;event&quot; } } </description> 
   <pubDate>Sun, 05 Sep 2010 20:57:04 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59875</link> 
  </item> 
   
  <item> 
   <title>db-&gt;selectAssoc is calling db-&gt;selectAll. If I compare base </title> 
   <description>db-&gt;selectAssoc is calling db-&gt;selectAll. If I compare base and mysql implementation, selectAll is coded differently. Content is using only base at the moment. I guess thats the issue.</description> 
   <pubDate>Mon, 06 Sep 2010 21:35:29 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59883</link> 
  </item> 
   
  <item> 
   <title>It seems it&#039;s not only a kronolith/content issue. I have a s</title> 
   <description>It seems it&#039;s not only a kronolith/content issue. I have a similiar issue with perms. It seems I am only using base and not the mysql specific db adapter. any ideas?</description> 
   <pubDate>Mon, 06 Sep 2010 22:19:36 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59885</link> 
  </item> 
   
  <item> 
   <title>Do you have pdo and pdo_mysql enabled in PHP?</title> 
   <description>Do you have pdo and pdo_mysql enabled in PHP?</description> 
   <pubDate>Tue, 07 Sep 2010 00:00:53 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59888</link> 
  </item> 
   
  <item> 
   <title>&gt; Do you have pdo and pdo_mysql enabled in PHP?
With the Ho</title> 
   <description>&gt; Do you have pdo and pdo_mysql enabled in PHP?
With the Horde System Test I get the following:

PHP Module Capabilities
MySQL Support: Yes
PDO: Yes</description> 
   <pubDate>Tue, 07 Sep 2010 09:05:03 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59898</link> 
  </item> 
   
  <item> 
   <title>...sure, but do you have the mysql pod module as well? This </title> 
   <description>...sure, but do you have the mysql pod module as well? This is separate from PDO itself, and different then the native mysql support.</description> 
   <pubDate>Tue, 07 Sep 2010 14:30:59 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59904</link> 
  </item> 
   
  <item> 
   <title>In test.php I can see the pdo_mysql extension is activated. </title> 
   <description>In test.php I can see the pdo_mysql extension is activated. I am just wondering because the function list is empty. Is this maybe an issue?</description> 
   <pubDate>Tue, 07 Sep 2010 22:20:30 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59917</link> 
  </item> 
   
  <item> 
   <title>I just tested PDO with this snippet. It was working fine.
$</title> 
   <description>I just tested PDO with this snippet. It was working fine.
$dbh = new PDO(&#039;mysql:host=localhost;dbname=test&#039;,&#039;mydbuser&#039;,&#039;mydbpassword&#039;);
</description> 
   <pubDate>Tue, 07 Sep 2010 22:27:52 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59918</link> 
  </item> 
   
  <item> 
   <title>Passing on to Chuck... I can&#039;t reproduce and I&#039;m not as inti</title> 
   <description>Passing on to Chuck... I can&#039;t reproduce and I&#039;m not as intimate with Horde_Db code.</description> 
   <pubDate>Tue, 07 Sep 2010 23:11:28 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59919</link> 
  </item> 
   
  <item> 
   <title>In old versions there was a factory method in Adapter.php fo</title> 
   <description>In old versions there was a factory method in Adapter.php for implementing the Horde_Db_ class. Where is this logic done now?</description> 
   <pubDate>Wed, 08 Sep 2010 19:13:41 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59937</link> 
  </item> 
   
  <item> 
   <title>I guess I found the issue. The implementation of the pdo_mys</title> 
   <description>I guess I found the issue. The implementation of the pdo_mysql adapter is incomplete. I changed the coding to switch to normal mysql adapter. Now kronolith and perms are working fine. I assume the mysql-specific coding for selectAll is missing in pdo_mysql. Can you confirm?</description> 
   <pubDate>Wed, 08 Sep 2010 20:14:21 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59939</link> 
  </item> 
   
  <item> 
   <title>&gt; In old versions there was a factory method in Adapter.php </title> 
   <description>&gt; In old versions there was a factory method in Adapter.php for 
&gt; implementing the Horde_Db_ class. Where is this logic done now?

Horde_Core_Factory_Db </description> 
   <pubDate>Wed, 08 Sep 2010 20:22:05 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59940</link> 
  </item> 
   
  <item> 
   <title>&gt; I guess I found the issue. The implementation of the pdo_m</title> 
   <description>&gt; I guess I found the issue. The implementation of the pdo_mysql 
&gt; adapter is incomplete.

No, it looks fine. That&#039;s the adapter that I&#039;m using with no issues.  Horde_Db_Adapter_Pdo_Mysql extends Horde_Db_Adapter_Pdo_Base, and the implementation in *_Pdo_Base looks fine.

Are you sure you are 100% up to date with git and have no local modifications?
</description> 
   <pubDate>Wed, 08 Sep 2010 21:05:32 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59942</link> 
  </item> 
   
  <item> 
   <title>what is the result if you dump fetchall results from line 14</title> 
   <description>what is the result if you dump fetchall results from line 145 of Adapter/Pdo/Base.php? </description> 
   <pubDate>Wed, 08 Sep 2010 21:12:58 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59945</link> 
  </item> 
   
  <item> 
   <title>array(2) { [0]=&gt;  array(1) { [1]=&gt;  string(8) &quot;calendar&quot; } [</title> 
   <description>array(2) { [0]=&gt;  array(1) { [1]=&gt;  string(8) &quot;calendar&quot; } [1]=&gt;  array(1) { [2]=&gt;  string(5) &quot;event&quot; } } </description> 
   <pubDate>Wed, 08 Sep 2010 21:44:09 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59949</link> 
  </item> 
   
  <item> 
   <title>Ok. I think I know what&#039; s wrong.  What version of PHP are y</title> 
   <description>Ok. I think I know what&#039; s wrong.  What version of PHP are you running?</description> 
   <pubDate>Wed, 08 Sep 2010 23:04:31 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59951</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in Git for this ticket:

PDO::FETCH_K</title> 
   <description>Changes have been made in Git for this ticket:

PDO::FETCH_KEY_PAIR is only available since PHP 5.2.3
Bug: 9223

http://git.horde.org/diff.php/framework/Db/lib/Horde/Db/Adapter/Pdo/Base.php?rt=horde-git&amp;r1=c104a5b3f580a516f34d2c1efe7241a167e280f4&amp;r2=f6c4867ad140073c32b030c0510c31b0aa7d688f</description> 
   <pubDate>Wed, 08 Sep 2010 23:14:21 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59952</link> 
  </item> 
   
  <item> 
   <title>Try now?</title> 
   <description>Try now?</description> 
   <pubDate>Wed, 08 Sep 2010 23:14:45 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59953</link> 
  </item> 
   
  <item> 
   <title>I have PHP Version: 5.2.3-1~edh.0. So this coding is not wor</title> 
   <description>I have PHP Version: 5.2.3-1~edh.0. So this coding is not working for me.</description> 
   <pubDate>Thu, 09 Sep 2010 22:20:09 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59961</link> 
  </item> 
   
  <item> 
   <title>Alright, well, since those results are coming directly from </title> 
   <description>Alright, well, since those results are coming directly from PDO, that leaves two possibilities: either your PHP build is broken, or the PHP documentation is incorrect.

Can you see what the following outputs on your system?
echo constant(&#039;PDO::FETCH_KEY_PAIR&#039;);

</description> 
   <pubDate>Thu, 09 Sep 2010 23:56:58 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59966</link> 
  </item> 
   
  <item> 
   <title>Also, what does echo PHP_VERSION output?</title> 
   <description>Also, what does echo PHP_VERSION output?</description> 
   <pubDate>Fri, 10 Sep 2010 00:00:01 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59967</link> 
  </item> 
   
  <item> 
   <title>&gt; Also, what does echo PHP_VERSION output?
PHP VERSION: 5.2</title> 
   <description>&gt; Also, what does echo PHP_VERSION output?
PHP VERSION: 5.2.3-1~edh.0
PDO::FETCH_KEY_PAIR: 12

I had issues with updating php5 with debian etch. maybe that&#039;s the reason?</description> 
   <pubDate>Fri, 10 Sep 2010 06:30:52 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59968</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; Also, what does echo PHP_VERSION output?
&gt; PHP VERSION: </title> 
   <description>&gt;&gt; Also, what does echo PHP_VERSION output?
&gt; PHP VERSION: 5.2.3-1~edh.0
&gt; PDO::FETCH_KEY_PAIR: 12

Well, this is definitely not a horde bug then. We are passing the correct constant to the correct PDO library call, and getting back the wrong data structure.  You can try investigating this further with your distribution&#039;s PHP maintainer, or try compiling PHP from source.

</description> 
   <pubDate>Fri, 10 Sep 2010 17:03:23 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9223#t59978</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
