Issue Bug Closed

#43113Problems with Extension Manager and PostgreSQL

Gerald Buttinger 11/19/12, 18:24 updated 08/07/15, 11:34

Description

the Extension Manager of TYPO3 v.4.7.7 (and possibly others) is not working on installations at PostrgreSQL-databases using DBAL.

import works, but only the installed extensions are displayed.

the problems lie in the function “getExtensionListFromRepository” in file “typo3/sysext/em/classes/database/class.tx_em_database.php”. the SELECT-statement in line 100 fails for the following reasons:

1. the content of the parameter $andWhere is delivered to the function e.g. this way:

AND cache_extensions.extkey IN (“about”,“aboutmodules”,…..

in postgres, this where-clause is not valid. the strings in the IN-brackets must be encapsulated in single quotes.
a quick fix is to put this line at the beginning of the function:

$andWhere = str_replace(‘”’,”’”,$andWhere);

2. “ce.extkey” is the only column stated in the groupBy-clause, but all other columns are also present in the select-part (cache_extensions.*). in postgres every selected column, which is not in an aggreagete-function, must appear in the groupBy-clause.

i simply fixed this by removing the groupBy and the aggregate function – as well as the join (i didn’t get the meaning of that join anyway).

the select-call looks like this now:

$ret[‘results’] = $GLOBALS[‘TYPO3_DB’]->exec_SELECTgetRows(
‘cache_extensions.*, cache_extensions.intversion AS maxintversion’ .
($addFields === ‘’ ? ‘’ : ‘,’ . $addFields),
‘cache_extensions’,
‘cache_extensions.lastversion=1 AND cache_extensions.repository=’ . intval($repository) . $andWhere,
‘’,
$order,
$limit
);

of course, these fixes are quick hacks by me to get the EM working. someone with more knowledge of the EM should probably integrate some proper fixes.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.