[Tickets #10410] SQL error comparing image_id with object_name of rampage_objects

bugs at horde.org bugs at horde.org
Wed Aug 3 16:19:28 UTC 2011


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/10410
------------------------------------------------------------------------------
  Ticket             | 10410
  Created By         | thpo+horde at dotrc.de
  Summary            | SQL error comparing image_id with object_name of
                     | rampage_objects
  Queue              | Ansel
  Version            | Git master
  Type               | Bug
  State              | Unconfirmed
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


thpo+horde at dotrc.de (2011-08-03 16:19) wrote:

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.






More information about the bugs mailing list