Omeka-S Reference module


I have a problem when I click on an index (ex. : Provenance (dcterms-provenance)) :

Omeka S has encountered an error

[Syntax Error] line 0, col 7: Error: Expected known function, got ‘ANY_VALUE’

Détails :

Doctrine\ORM\Query\QueryException: SELECT ANY_VALUE(value.value) AS val, COUNT(DISTINCT AS total, UPPER(SUBSTRING(value.value, 1, 1))AS initial, MIN( AS first FROM Omeka\Entity\Value value INNER JOIN Omeka\Entity\Item resource WITH value.resource = resource WHERE = :property AND value.value IS NOT NULL AND IN(SELECT FROM Omeka\Entity\Item omeka_root) GROUP BY val ORDER BY val ASC in /applis/omeka/home/www/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php:43

Does anyone have any ideas?

Thanks a lot.

1 Like

It is related to your version of mysql/mariadb, that added a new parameter by default in the config.
What is the version of the module and database you use ? Normally, this issue was fixed in the last version (3.4.17), but I may have forgotten some check to determine any version.


Thanks for your answer.

We use the last version v3.4.17 of this module.

Our version of mysql is v5.7.28-0 and our operating system is Ubuntu 18.04

Small supplement :

I launched that query on our database :
select any_value(name) from user group by name;

And it showed me a result without problem.
Therefore, the function exists and is active.

Yes it’s strange. You have the official mysql version, and there is a check for the function, so I can’t understand why it says it is not available here in the query . So it’s hard to understand. You may fix by reverting the fix in :

! $this->supportAnyValue ? 'ANY_VALUE(value.value) AS val' : 'value.value AS val',

But I don’t know if it will work.

A better solution may be to replace the line with:

    'GROUP_CONCAT(DISTINCT value.value) AS val',

Could you tell me if it works on your server?
Normally, all values are the same, except for case sensitivity, that’s why it’s possible to choose any value or to select distinct values only.

We use a Mysql package on the official Ubuntu 18 repository.

It works with your first solution : ! $this->supportAnyValue ? ‘ANY_VALUE(value.value) AS val’ : ‘value.value AS val’,

but not with the second : ‘GROUP_CONCAT(DISTINCT value.value) AS val’,

The error is as follows:


An exception occurred while executing ‘SELECT GROUP_CONCAT(DISTINCT v0_.value) AS sclr_0, COUNT(DISTINCT AS sclr_1, UPPER(SUBSTRING(v0_.value FROM 1 FOR 1)) AS sclr_2, MIN( AS sclr_3 FROM value v0_ INNER JOIN (item i2_ INNER JOIN resource r1_ ON = ON (v0_.resource_id = WHERE v0_.property_id = ? AND v0_.value IS NOT NULL AND IN (SELECT FROM item i4_ INNER JOIN resource r3_ ON = GROUP BY sclr_0 ORDER BY sclr_0 ASC’ with params [51]: SQLSTATE [42000]: Syntax error or access violation: 1056 Can’t group on ‘sclr_0’.

Details :

PDOException: SQLSTATE [42000]: Syntax error or access violation: 1056 Can’t group on ‘sclr_0’ in /applis/omeka/home/wwww/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117

Ok, thanks. Anyway, it’s strange, since the function is checked before processing and on all other servers I checked it works. What is the url for ?

when I click on an index (ex. : Provenance (dcterms-provenance))

I finally find a way to reproduce it. It’s related to an outdated doctrine package. The version 3.4.18 of the module fixes it.

That’s great. I’ve installed version V3.4.18 and there’s no more problems.

Thank you very much for that.