Enforce the language on the JOIN, not the WHERE
This commit is contained in:
parent
19cf074fc4
commit
bea4422bdc
@ -1962,10 +1962,11 @@ function mfh_getDisplayTextForStatusId($statusId) {
|
||||
|
||||
$statusRs = hesk_dbQuery("SELECT `text`, `Key`, `language` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` AS `statuses`
|
||||
LEFT JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."text_to_status_xref` ON `status_id` = `statuses`.`ID`
|
||||
WHERE `statuses`.`ID` = ".intval($statusId)." AND `language` = '".hesk_dbEscape($hesk_settings['language'])."'");
|
||||
AND `language` = '".hesk_dbEscape($hesk_settings['language'])."'
|
||||
WHERE `statuses`.`ID` = ".intval($statusId));
|
||||
|
||||
$statusRec = hesk_dbFetchAssoc($statusRs);
|
||||
if ($statusRec['language'] == $hesk_settings['language'] && $statusRec['text'] != NULL) {
|
||||
if ($statusRec['text'] != NULL) {
|
||||
// We found a record. Use the text field
|
||||
return $statusRec['text'];
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user