Skip to content

Commit

Permalink
Fix bad SQL query causing city lookup to fail
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed Jul 25, 2017
1 parent 56c2728 commit 55e6b67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions api/v3/PostcodeAT/Get.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ function civicrm_api3_postcode_a_t_get($params) {
}

$selectFields = $validatedParams['return'];
$sql = "SELECT DISTINCT {$selectFields} FROM `civicrm_postcodeat` WHERE 1 {$where} LIMIT 0, 100";
$sql = "SELECT DISTINCT {$selectFields} FROM `civicrm_postcodeat` WHERE 1 {$where}";
// For ortnam (City) we select gemnam38 (Politische Gemeinde) as well
if ($selectFields == 'ortnam') {
$sql.= " UNION SELECT gemnam38 FROM `civicrm_postcodeat` WHERE 1 {$where} LIMIT 0, 100";
$sql.= " UNION SELECT gemnam38 FROM `civicrm_postcodeat` WHERE 1 {$where}";
}
$sql .= " LIMIT 0, 100";
$dao = CRM_Core_DAO::executeQuery($sql, $values);

$returnValues = array();
Expand Down
6 changes: 3 additions & 3 deletions info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<email>[email protected]</email>
</maintainer>
<urls>
<url desc="Main Extension Page">https://github.com/mattwire/de.systopia.postcodeat</url>
<url desc="Main Extension Page">https://github.com/systopia/de.systopia.postcodeat</url>
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2017-07-20</releaseDate>
<version>1.0.beta1</version>
<releaseDate>2017-07-25</releaseDate>
<version>1.0.beta2</version>
<develStage>beta</develStage>
<compatibility>
<ver>4.6</ver>
Expand Down

0 comments on commit 55e6b67

Please sign in to comment.