6.0.0-beta1
7/8/25

[#10410] SQL error comparing image_id with object_name of rampage_objects
Summary SQL error comparing image_id with object_name of rampage_objects
Queue Ansel
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester thpo+horde (at) dotrc (dot) de
Created 08/03/2011 (5088 days ago)
Due
Updated 08/06/2011 (5085 days ago)
Assigned 08/03/2011 (5088 days ago)
Resolved 08/05/2011 (5086 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
08/06/2011 06:46:23 PM Michael Rubinsky Comment #9 Reply to this comment
*sigh*

Hopefully it's correct now :)
08/05/2011 07:41:45 PM thpo+horde (at) dotrc (dot) de Comment #8 Reply to this comment
Could you have a second look at ansel/lib/Tagger.php (line 114)? I 
think you have a typo in the variable name (slid vs. lid).
08/05/2011 03:09:04 PM Michael Rubinsky Comment #7
Assigned to Michael Rubinsky
State ⇒ Resolved
Reply to this comment
Not quite a duplicate. Fixed.
08/05/2011 02:58:32 PM Git Commit Comment #6 Reply to this comment
Changes have been made in Git for this ticket:

Application ids passed to the content tagger must *always* be typed as string.
Fixes Bug: 10410 on certain RDBMS

  1 files changed, 11 insertions(+), 1 deletions(-)
http://git.horde.org/horde-git/-/commit/8e23a60068882041df5286aee4e4d1e9f2354233
08/03/2011 04:52:06 PM Michael Rubinsky Comment #5 Reply to this comment
Please have a second look at it?
Don't have access to the code right now. Will check when I'm back in 
front of computer later tonight.

08/03/2011 04:47:17 PM thpo+horde (at) dotrc (dot) de Comment #4 Reply to this comment
Sorry, I just had another look at your patch to 10171. Could it be, 
that you missed this issue in the method exists() of 
Content_Object_Manager?

Please have a second look at it?
08/03/2011 04:41:21 PM Michael Rubinsky State ⇒ Duplicate
 
08/03/2011 04:37:12 PM thpo+horde (at) dotrc (dot) de Comment #3 Reply to this comment
Yes this really is a duplicate of 10171. Sorry.

I have a normal install of the latest released H4 components and just 
ansel from git.
08/03/2011 04:30:54 PM Michael Rubinsky Comment #2
State ⇒ Feedback
Reply to this comment
This sounds like a duplicate of Bug: 10171

Are you running git for the entire install or just Ansel?
08/03/2011 04:19:28 PM thpo+horde (at) dotrc (dot) de Comment #1
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ Ansel
Summary ⇒ SQL error comparing image_id with object_name of rampage_objects
Type ⇒ Bug
Reply to this comment
Viewing images/galleries results in SQL-errors when checking for tags.

The problem is in content/lib/Objects/Manager.php:exists().

As the $objects passed by ansel are integers, the resulting SQL 
statement fails with:

ERR: HORDE [ansel] SQL QUERY FAILED: SQLSTATE[42883]: Undefined 
function: 7 ERROR:  operator does not exist: character varying = integer
ZEILE 1: ...ect_name FROM "rampage_objects" WHERE object_name IN (2) AND...
                                                               ^
TIP:  No operator matches the given name and argument type(s). You 
might need to add explicit type casts.
         SELECT object_id, object_name FROM "rampage_objects" WHERE 
object_name IN (2) AND type_id = 4 [pid 14540 on line 808 of 
"/usr/share/php/Horde/Db/Adapter/Base.php"]

My temporary solution to circumvent this problem is this patch to the 
Content_Objects_Manager:

--- Manager.orig        2011-08-03 17:49:33.639159486 +0200
+++ Manager.php 2011-08-03 18:06:40.249214851 +0200
@@ -64,7 +64,9 @@
          if (!count($objects)) {
              throw new InvalidArgumentException('No object requested');
          }
-        $params = $objects;
+       foreach ( $objects as $object_value ) {
+               $params[] = $object_value .'';
+       }
          $params[] = $type;

          try {


But I think it might be cleaner to fix this in ansel directly.

Saved Queries