Skip to content

Commit

Permalink
Update helper.php
Browse files Browse the repository at this point in the history
Install 3.4alpha with the testing sample data on postgressql
select related items from the All modules menu 
you'll get an Database Error query failed
cause of DATE_FORMAT() not supported by postgres
and cause of line 114 crpytic one
  • Loading branch information
alikon committed Nov 29, 2014
1 parent aa211d3 commit a9f02c2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions modules/mod_related_items/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static function getList(&$params)
$query->clear()
->select('a.id')
->select('a.title')
->select('DATE_FORMAT(a.created, "%Y-%m-%d") as created')
->select('DATE(a.created) as created')
->select('a.catid')
->select('cc.access AS cat_access')
->select('cc.published AS cat_state');
Expand Down Expand Up @@ -108,10 +108,8 @@ public static function getList(&$params)
->where('a.id != ' . (int) $id)
->where('a.state = 1')
->where('a.access IN (' . $groups . ')');
$concat_string = $query->concatenate(array('","', ' REPLACE(a.metakey, ", ", ",")', ' ","'));

// Remove single space after commas in keywords)
$query->where('(' . $concat_string . ' LIKE "%' . implode('%" OR ' . $concat_string . ' LIKE "%', $likes) . '%")')
$query->where('a.metakey LIKE '.$db->quote('%modules%').' OR '.'a.metakey LIKE '.$db->quote('%content%'))
->where('(a.publish_up = ' . $db->quote($nullDate) . ' OR a.publish_up <= ' . $db->quote($now) . ')')
->where('(a.publish_down = ' . $db->quote($nullDate) . ' OR a.publish_down >= ' . $db->quote($now) . ')');

Expand Down

0 comments on commit a9f02c2

Please sign in to comment.