Project

General

Profile

Actions

Bug #43113

closed

Problems with Extension Manager and PostgreSQL

Added by Gerald Buttinger over 11 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Should have
Category:
Database API (Doctrine DBAL)
Target version:
Start date:
2012-11-19
Due date:
% Done:

0%

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

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.

Actions

Also available in: Atom PDF