Summary | Kronolith_Tagger: ensureTypes not recognizing existing types |
Queue | Kronolith |
Queue Version | Git master |
Type | Bug |
State | Not A Bug |
Priority | 1. Low |
Owners | mrubinsk (at) horde (dot) org |
Requester | test (at) horde (dot) org |
Created | 09/04/2010 (5433 days ago) |
Due | |
Updated | 09/10/2010 (5427 days ago) |
Assigned | 09/04/2010 (5433 days ago) |
Resolved | 09/10/2010 (5427 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
State ⇒ Not A Bug
PDO::FETCH_KEY_PAIR: 12
correct constant to the correct PDO library call, and getting back the
wrong data structure. You can try investigating this further with
your distribution's PHP maintainer, or try compiling PHP from source.
PDO::FETCH_KEY_PAIR: 12
I had issues with updating php5 with debian etch. maybe that's the reason?
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('PDO::FETCH_KEY_PAIR');
Assigned to Michael Rubinsky
Taken from Chuck Hagenbuch
PDO::FETCH_KEY_PAIR is only available since PHP 5.2.3
Bug: 9223http://git.horde.org/diff.php/framework/Db/lib/Horde/Db/Adapter/Pdo/Base.php?rt=horde-git&r1=c104a5b3f580a516f34d2c1efe7241a167e280f4&r2=f6c4867ad140073c32b030c0510c31b0aa7d688f
array(1) { [2]=> string(5) "event" } }
Adapter/Pdo/Base.php?
adapter is incomplete.
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?
implementing the Horde_Db_ class. Where is this logic done now?
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?
implementing the Horde_Db_ class. Where is this logic done now?
Summary ⇒ Kronolith_Tagger: ensureTypes not recognizing existing typesc
Assigned to Chuck Hagenbuch
Horde_Db code.
$dbh = new PDO('mysql:host=localhost;dbname=test','mydbuser','mydbpassword');
wondering because the function list is empty. Is this maybe an issue?
separate from PDO itself, and different then the native mysql support.
PHP Module Capabilities
MySQL Support: Yes
PDO: Yes
issue with perms. It seems I am only using base and not the mysql
specific db adapter. any ideas?
implementation, selectAll is coded differently. Content is using only
base at the moment. I guess thats the issue.
array(2) { [0]=> array(1) { [1]=> string(8) "calendar" } [1]=>
array(1) { [2]=> string(5) "event" } }
Array ( [0] => Array ( [1] => calendar ) [1] => Array ( [2] => event ) )
-> $id=0; $type=Array ( [1] => calendar )
-> $id=1; $ype=Array ( [2] => event )
var_dump($this->_db->selectAssoc('SELECT type_id,
type_name FROM ' . $this->_t('types') . ' WHERE type_name IN
('.implode(',', array_map(array($this->_db, 'quote'),
array_keys($typeName))).')'));
?
When I dump that, I (correctly) get:
array(2) { [1]=> string(8) "calendar" [2]=> string(5) "event" }
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, 'calendar'),
(2, 'event');
The result of the db-statement is:
Array ( [0] => Array ( [1] => calendar ) [1] => Array ( [2] => event ) )
-> $id=0; $type=Array ( [1] => calendar )
-> $id=1; $ype=Array ( [2] => event )
1. loop:
$key: 0
$type: Array ( [calendar] => 1 )
2. loop:
$key: 1
$type: Array ( [event] => 2 )
db->selectAssoc() call (line 70 or so)? That looks badly broken.
What does your table look like?
a string?
That'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.
1. loop:
$key: 0
$type: Array ( [calendar] => 1 )
2. loop:
$key: 1
$type: Array ( [event] => 2 )
If I understand everything right, it should be:
1. loop:
$key: 1
$type: calendar
2. loop:
$key: 2
$type: event
bugs, devs get multiple bounce notices each time one of your tickets
is updated.
a string?
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.
Array ( [0] => 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
believe this part was ever working. Can you confirm?
the sql statement is returning id/name. So the unset is not working. I
am using Mysql. Any idea?
ensureTypes. If I change the coding from "if (is_int($type)" to "if
(is_int($typeIndex))" everything works fine.
You can see what the query on line 69 returns from your DB, and
compare it with what you think it should return.
ensureTypes. If I change the coding from "if (is_int($type)" to "if
(is_int($typeIndex))" everything works fine.
My database looks like this:
type_id type_name
1 calendar
2 event
migrating down and up again. everything works fine. thx
State ⇒ Feedback
anything related to the database? Can you provide steps to reproduce?
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ Kronolith
Type ⇒ Bug
Summary ⇒ Kronolith_Tagger: ensureTypes not recognizing existing types
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
'calendar' for key 2