Project

General

Profile

Actions

Bug #16779

closed

Templavoila & ORACLE wont work (DBAL 0.9.9)

Added by Michael Ablass almost 18 years ago. Updated almost 15 years ago.

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

0%

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

Description

Using Templavoila and ORACLE wont work at the moment because its neccessary to map "tx_templavoila_datastructure" to something like "tx_templavoila_ds" in the localconf.php AND a further problem with the DBAL: When mapping a query like

SELECT "tx_templavoila_tmplobj"."uid", "tx_templavoila_tmplobj"."title", "tx_templavoila_tmplobj"."t3ver_id", "tx_templavoila_tmplobj"."t3ver_state", "tx_templavoila_tmplobj"."t3ver_wsid", "tx_templavoila_tmplobj"."t3ver_count", "tx_templavoila_tmplobj"."previewicon" FROM "tx_templavoila_tmplobj", "pages" WHERE "pages"."uid" = "tx_templavoila_tmplobj"."pid" AND "pages"."deleted" = 0 AND "tx_templavoila_tmplobj"."deleted" = 0 AND 1 = 1 AND "tx_templavoila_tmplobj"."parent" = 0 AND "tx_templavoila_tmplobj"."uid" != "1" ORDER BY "tx_templavoila_tmplobj"."title"

the result would be

SELECT "tx_tv_tmplobj"."uid", "tx_tv_tmplobj"."title", "tx_tv_tmplobj"."t3ver_id", "tx_tv_tmplobj"."t3ver_state", "tx_tv_tmplobj"."t3ver_wsid", "tx_tv_tmplobj"."t3ver_count", "tx_tv_tmplobj"."previewicon" FROM "tx_tv_tmplobj", "pages" WHERE "pages"."uid" = "tx_templavoila_tmplobj"."pid" AND "pages"."deleted" = 0 AND "tx_tv_tmplobj"."deleted" = 0 AND 1 = 1 AND "tx_tv_tmplobj"."parent" = 0 AND "tx_tv_tmplobj"."uid" != "1" ORDER BY "tx_tv_tmplobj"."title"

Means: one where clause contains "tx_templavoila_tmplobj" and not "tx_tv_tmplobj".

The Solution: :)

function map_sqlParts(&$sqlPartArray, $defaultTable)

...
// Map table?
if ($sqlPartArray[$k]['table'] && $this->mapping[$sqlPartArray[$k]['table']]['mapTableName']) {
$sqlPartArray[$k]['table'] = $this->mapping[$sqlPartArray[$k]['table']]['mapTableName'];
}
[NEW]

if ($sqlPartArray[$k]['value'] && is_array($sqlPartArray[$k]['value']))
{
foreach ($sqlPartArray[$k]['value'] as $nKey => $strVal) {
foreach ($this->mapping as $nKey2 => $arValue2) {
$sqlPartArray[$k]['value'][$nKey] = preg_replace('/'.$nKey2.'/',$arValue2['mapTableName'],$sqlPartArray[$k]['value'][$nKey]);
}
//ORA-00904: "1": ungültiger Bezeichner This may indicate a table defined in tables.php is not existing in the database!
if ($strVal == '"') {
$sqlPartArray[$k]['value'][$nKey] = '';
}
}
}
}

[END]

there is even another bug/problem fixed ("ORA-00904: "1": ungültiger Bezeichner This may indicate a table defined in tables.php is not existing in the database!"). Maybe thats not the right position in the code, but it seems to work.

(issue imported from #M4638)


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #17232: Fieldmapping doenst work on the "right side" in where clause.ClosedKarsten Dambekalns2007-04-23

Actions
Actions

Also available in: Atom PDF