Merge #18233 - Fix #18212 - Query Builder doesn't replace a table name with it's alias in the WHERE block

Fixes: #18212
Pull-request: #18233

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2023-05-06 11:12:15 +02:00
commit 61374f4696
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889

View File

@ -33,7 +33,10 @@ function getFormatsText () {
}
function generateCondition (criteriaDiv, table) {
var query = '`' + Functions.escapeBacktick(table.val()) + '`.';
const tableName = table.val();
const tableAlias = table.siblings('.table_alias').val();
var query = '`' + Functions.escapeBacktick(tableAlias === '' ? tableName : tableAlias) + '`.';
query += '`' + Functions.escapeBacktick(table.siblings('.columnNameSelect').first().val()) + '`';
if (criteriaDiv.find('.criteria_rhs').first().val() === 'text') {
var formatsText = getFormatsText();