Project

General

Profile

Actions

Bug #72017

closed

PostgreSQL exception when trying to translate or copy a content element to another language

Added by Lars Peter Søndergaard over 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Start date:
2015-12-02
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
postgresql
Complexity:
Is Regression:
No
Sprint Focus:

Description

To reproduce:

- Use PostgreSQL as database.
- Add a second system language
- Try to translate a content element to the second language.

The Ajax request will fail with the following exception:

Uncaught TYPO3 Exception
#1421053336: ADOdb could not run this query: SELECT "sys_language"."uid" FROM "tt_content", "sys_language" WHERE "tt_content"."sys_language_uid" = "sys_language"."uid" AND "tt_content"."colPos" = 0 AND "tt_content"."pid" = 1 AND "sys_language"."uid" <> 1 AND "tt_content"."deleted" = 0 AND ("tt_content"."t3ver_state" <= 0 OR "tt_content"."t3ver_wsid" = 0) GROUP BY "tt_content"."sys_language_uid" ORDER BY "sys_language"."title" (More information)

RuntimeException thrown in file
/var/www/pgsql/typo3_src-7.6.0/typo3/sysext/dbal/Classes/Database/DatabaseConnection.php in line 855.

10 TYPO3\CMS\Dbal\Database\DatabaseConnection::exec_SELECTquery("sys_language.uid", "tt_content,sys_language", "tt_content.sys_language_uid=sys_language.uid AND t…ent.t3ver_state <= 0 OR tt_content.t3ver_wsid = 0)", "tt_content.sys_language_uid", "sys_language.title")

/var/www/pgsql/typo3_src-7.6.0/typo3/sysext/backend/Classes/Controller/Page/LocalizationController.php:
00102:                 'tt_content.sys_language_uid',
00103:                 'sys_language.title'
00104:             );
00105:             while ($row = $databaseConnection->sql_fetch_assoc($res)) {
00106:                 if (isset($systemLanguages[$row['uid']])) {

9 TYPO3\CMS\Backend\Controller\Page\LocalizationController::getUsedLanguagesInPageAndColumn(TYPO3\CMS\Core\Http\ServerRequest, TYPO3\CMS\Core\Http\Response)
8 call_user_func_array(array, array)

/var/www/pgsql/typo3_src-7.6.0/typo3/sysext/backend/Classes/Http/RouteDispatcher.php:
00052:         $targetIdentifier = $route->getOption('target');
00053:         $target = $this->getCallableFromTarget($targetIdentifier);
00054:         return call_user_func_array($target, array($request, $response));
00055:     }
00056: 

After dumping sql_error() right before the exception I get:

'FEHLER: Spalte „sys_language.uid“ muss in der GROUP-BY-Klausel erschein
   en oder in einer Aggregatfunktion verwendet werden LINE 1: SELECT "sys_
   language"."uid" FROM "tt_content", "sys_langua
   ge... ^' (215 chars)

Essentially saying, that sys_language.uid has to be in GROUP BY clause or in an aggregate function.

Actions

Also available in: Atom PDF