Database error on 'Reload strings' - Multilingual

Permalink
Hi there,

Whenever I go to "System & Settings > Multilingual > Translate Site Interface" and try to 'Reload Strings' I get this error:

An unexpected error occurred.
An exception occurred while executing 'select distinct (binary arHandle) as AreaName from Areas order by arHandle': SQLSTATE[HY000]: General error: 3065 Expression #1 of ORDER BY clause is not in SELECT list, references column 'my_db_name.Areas.arHandle' which is not in SELECT list; this is incompatible with DISTINCT


Have no clue what to do or if it is just me. Found nothing about it.

View Replies: View Best Answer
mlocati replied on at Permalink Reply
mlocati
In order to replicate this, I'd need the MySQL version and its running mode.

In order to determine these values you can run these two mysql queries:

-- Determine the MySQL version
select @@version;

-- Determine the MySQL mode:
select @@sql_mode;
nmpribeiro replied on at Permalink Reply
concrete/vendor/mlocati/concrete5-translation-library/src/Parser/DynamicItem/Area.php

<?php
namespace C5TL\Parser\DynamicItem;
/**
 * Extract translatable data from Areas.
 */
class Area extends DynamicItem
{
    /**
     * @see \C5TL\Parser\DynamicItem::getParsedItemNames()
     */
    public function getParsedItemNames()
    {
        return function_exists('t') ? t('Area names') : 'Area names';
    }
    /**



This line $rs = $db->Execute('select distinct (binary arHandle) as AreaName from Areas order by arHandle'); must be giving the error. I am no SQL programmer, so I am at a loss.
nmpribeiro replied on at Permalink Reply
@mlocati:

-- Determine the MySQL version
select @@version;
5.7.15


-- Determine the MySQL mode:
select @@sql_mode;
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
mlocati replied on at Permalink Best Answer Reply
mlocati
Next concrete5 version will contain a fix for this.
In the meanwhile, you can fix it yourself by changing the failing query (that you correctly identified), by adding "binary " right before the last "arHandle", so that you'll have this query:
select distinct (binary arHandle) as AreaName from Areas order by binary arHandle

Could you confirm that this new query fixes the problem?

Thanks!
nmpribeiro replied on at Permalink Reply
@mlocati:

I confirm, that's a fix! Many thanks.