Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Correctly handle OR queries in the listing module (see #6344)
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Mar 17, 2014
1 parent 75c7078 commit 590cde7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions system/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Contao Open Source CMS changelog
Version 3.2.9 (2014-XX-XX)
--------------------------

### Fixed
Correctly handle OR queries in the listing module (see #6344).

### Fixed
Use a monospaced font for the plain text newsletter preview (see #6790).

Expand Down
4 changes: 2 additions & 2 deletions system/modules/listing/dca/tl_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
'label' => &$GLOBALS['TL_LANG']['tl_module']['list_search'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
'eval' => array('decodeEntities'=>true, 'maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);

Expand All @@ -71,7 +71,7 @@
'label' => &$GLOBALS['TL_LANG']['tl_module']['list_info'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
'eval' => array('decodeEntities'=>true, 'maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);

Expand Down
7 changes: 4 additions & 3 deletions system/modules/listing/modules/ModuleListing.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public function generate()

$this->strTemplate = $this->list_layout;
$this->list_where = $this->replaceInsertTags($this->list_where);
$this->list_info_where = $this->replaceInsertTags($this->list_info_where);

return parent::generate();
}
Expand Down Expand Up @@ -137,7 +138,7 @@ protected function compile()

if ($this->list_where)
{
$strQuery .= " WHERE " . $this->list_where;
$strQuery .= " WHERE (" . $this->list_where . ")";
}

$strQuery .= $strWhere;
Expand Down Expand Up @@ -177,7 +178,7 @@ protected function compile()

if ($this->list_where)
{
$strQuery .= " WHERE " . $this->list_where;
$strQuery .= " WHERE (" . $this->list_where . ")";
}

$strQuery .= $strWhere;
Expand Down Expand Up @@ -366,7 +367,7 @@ protected function listSingleRecord($id)
$this->list_info = deserialize($this->list_info);
$this->list_info_where = $this->replaceInsertTags($this->list_info_where);

$objRecord = $this->Database->prepare("SELECT " . $this->list_info . " FROM " . $this->list_table . " WHERE " . (($this->list_info_where != '') ? $this->list_info_where . " AND " : "") . $this->strPk . "=?")
$objRecord = $this->Database->prepare("SELECT " . $this->list_info . " FROM " . $this->list_table . " WHERE " . (($this->list_info_where != '') ? "(" . $this->list_info_where . ") AND " : "") . $this->strPk . "=?")
->limit(1)
->execute($id);

Expand Down

0 comments on commit 590cde7

Please sign in to comment.