You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not working for all profiles due to improper join; only some profiles correctly report the barnstars they have:
> nids = DrupalNode.find_all_by_uid(554, :conditions => {:type => "note"}, :order => "created DESC", :select => :nid).collect(&:nid)
node Columns (3.3ms) SHOW FIELDS FROM `node`
DrupalNode Load (0.3ms) SELECT nid FROM `node` WHERE `node`.`type` = 'note' AND `node`.`uid` = 554 ORDER BY created DESC
=> [8928, 8926, ... 1676, 1652, 1541, 831]
> DrupalNodeCommunityTag.find :all, :conditions => ["name LIKE ? AND nid IN (?)",'barnstar:%',nids.join(',')], :joins => :drupal_tag
community_tags Columns (3.0ms) SHOW FIELDS FROM `community_tags`
term_data Columns (2.2ms) SHOW FIELDS FROM `term_data`
DrupalNodeCommunityTag Load (1.2ms) SELECT `community_tags`.* FROM `community_tags` INNER JOIN `term_data` ON `term_data`.`tid` = `community_tags`.`tid` WHERE (name LIKE 'barnstar:%' AND nid IN ('8928,8926, ... 1541,831'))
=> []
However, manually changing it to outer join doesn't work either:
> DrupalNodeCommunityTag.find :all, :conditions => ["name LIKE ? AND nid IN (?) OUTER JOIN term_node ON term_node.tid = community_tags.tid",'barnstar:%',nids.join(',')]#, :joins => :drupal_tag
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OUTER JOIN term_node ON term_node.tid = community_tags.tid)' at line 1: SELECT `community_tags`.* FROM `community_tags` WHERE (name LIKE 'barnstar:%' AND nid IN ('8928,8926, ... 1652,1541,831') OUTER JOIN term_node ON term_node.tid = community_tags.tid)
The text was updated successfully, but these errors were encountered:
https://github.com/publiclab/plots2/blob/master/app/models/user.rb#L142-L148
This is not working for all profiles due to improper join; only some profiles correctly report the barnstars they have:
However, manually changing it to outer join doesn't work either:
The text was updated successfully, but these errors were encountered: