Skip to content

Commit 76ce953

Browse files
committed
Closes #2156 Fixes Sql Issue
# Issue #2156 # Summary Fixes mysql query error during query construction
1 parent 3964443 commit 76ce953

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

classes/ChecklistManager.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ private function setImages(){
369369
}
370370
if($missingArr = array_diff(array_keys($this->taxaList),$matchedArr)){
371371
$sql = 'SELECT m2.tid, m.url, m.thumbnailurl FROM media m INNER JOIN '.
372-
'(SELECT ts1.tid, SUBSTR(MIN(CONCAT(LPAD(m.sortsequence,6,"0"),m.mediaID)),7) AS mediaID'.
372+
'(SELECT ts1.tid, SUBSTR(MIN(CONCAT(LPAD(m.sortsequence,6,"0"),m.mediaID)),7) AS mediaID '.
373373
'FROM taxstatus ts1 INNER JOIN taxstatus ts2 ON ts1.tidaccepted = ts2.tidaccepted '.
374374
'INNER JOIN media m ON ts2.tid = m.tid '.
375375
'WHERE m.sortsequence < 500 AND (m.thumbnailurl IS NOT NULL) AND ts1.taxauthid = 1 AND ts2.taxauthid = 1 AND (ts1.tid IN('.implode(',',$missingArr).')) '.
@@ -378,7 +378,7 @@ private function setImages(){
378378
if($missingArr = array_diff(array_keys($this->taxaList),$matchedArr)){
379379
//Get children images
380380
$sql = 'SELECT DISTINCT m2.tid, m.url, m.thumbnailurl FROM media m INNER JOIN '.
381-
'(SELECT ts1.parenttid AS tid, SUBSTR(MIN(CONCAT(LPAD(m.sortsequence,6,"0"),m.mediaID)),7) AS mediaID'.
381+
'(SELECT ts1.parenttid AS tid, SUBSTR(MIN(CONCAT(LPAD(m.sortsequence,6,"0"),m.mediaID)),7) AS mediaID '.
382382
'FROM taxstatus ts1 INNER JOIN taxstatus ts2 ON ts1.tidaccepted = ts2.tidaccepted '.
383383
'INNER JOIN media m ON ts2.tid = m.tid '.
384384
'WHERE m.sortsequence < 500 AND (m.thumbnailurl IS NOT NULL) AND ts1.taxauthid = 1 AND ts2.taxauthid = 1 AND (ts1.parenttid IN('.implode(',',$missingArr).')) '.

0 commit comments

Comments
 (0)