6.0.0-alpha12
6/9/25

[#10439] Content_Tagger->getObjects: sql inner joins error
Summary Content_Tagger->getObjects: sql inner joins error
Queue Content
Queue Version 1.0.1
Type Bug
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester roman (at) stachura (dot) ch
Created 08/18/2011 (5044 days ago)
Due
Updated 08/30/2011 (5032 days ago)
Assigned 08/19/2011 (5043 days ago)
Resolved 08/30/2011 (5032 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch Yes

History
08/30/2011 12:02:36 AM Michael Rubinsky Comment #4
State ⇒ Resolved
Reply to this comment
Not sure which one of the many problems with this method your patch 
was supposed to fix,  but it didn't fix any of them ;)

There were broken method names, incorrect table aliases, incorrect 
joins, and issues with passing object identifiers. All issues should 
be fixed now for 1.0.2
08/29/2011 11:59:01 PM Git Commit Comment #3 Reply to this comment
Changes have been made in Git for this ticket:

Fix inner join with the object table, fixes failing test.
See Bug: 10439
we need to join on t2, not t1 here.

  2 files changed, 10 insertions(+), 4 deletions(-)
http://git.horde.org/horde-git/-/commit/b4bfd19ca7cccbe8a8c3dda46dcb9038f16a3267
08/29/2011 11:58:57 PM Git Commit Comment #2 Reply to this comment
Changes have been made in Git for this ticket:

this method was completely broken when passing objectId.
Bug: 10439

  1 files changed, 7 insertions(+), 3 deletions(-)
http://git.horde.org/horde-git/-/commit/a3d19396f3a9207f9d4907a528fdc99e04e731a3
08/19/2011 08:34:41 AM Jan Schneider Assigned to Michael Rubinsky
State ⇒ Assigned
 
08/18/2011 08:43:47 AM roman (at) stachura (dot) ch Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Content_Tagger->getObjects: sql inner joins error
Queue ⇒ Content
Milestone ⇒
Patch ⇒ Yes
New Attachment: 0001-getObjects-function-correct-sql-inner-join.patch Download
State ⇒ Unconfirmed
Reply to this comment
in the class Content_Tagger the
public function  getObjects has a some error in the sql. --> inner join.

The _ensureObject($args['objectId']) is not working this way.

this patch should fix it.



getObjects($args){

if (isset($args['objectId'])) {

    //$args['objectId'] = 
current($this->_objectManager->ensureObject($args['objectId']));
    (int)$objectId = $this->_ensureObject($args['objectId']);

    $sql = $this->_db->addLimitOffset('

             SELECT tagged2.object_id AS object_id, object_name
             FROM (' . $inner . ') AS t1
             INNER JOIN ' . $this->_tagged . ' AS tagged2
             ON t1.tag_id = tagged2.tag_id
             INNER JOIN ' . $this->_t('objects') . ' AS objects
             ON objects.object_id = tagged2.object_id
             WHERE tagged2.object_id != ' . $objectId . '
             GROUP BY t2.object_id',
             array('limit' => $radius)
    );

}
}

Saved Queries