Project

General

Profile

Actions

Bug #16779

closed

Templavoila & ORACLE wont work (DBAL 0.9.9)

Added by Michael Ablass over 17 years ago. Updated about 14 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 #1

Updated by Michael Ablass over 17 years ago

(The mapping is needed because of the 32 chars per field/name restriction of Oracle.)

Actions #2

Updated by Simon Boussekeyt about 17 years ago

This solution works!!!

But, in oracle databases varchar types are limited to 4000 chars. Then when i save my template mapping, if the result is upper than 4000 chars, none records are saved.

Have you a solution?

Actions #3

Updated by Michael Ablass about 17 years ago

With more than 4000 chars the VARCHAR fields are called CLOB. You need to change them in ORACE Adminsystem (havent tried this yet but the problem is well-known.

Actions #4

Updated by Simon Boussekeyt about 17 years ago

Thank you Michael for your ansmer!

I havealeady tested this solution, but it doesn't seem to work. None record are saved in database.

Someone have tried this solution?

Thanks,

Actions #5

Updated by Michael Ablass about 17 years ago

No sorry, no idea yet. At the moment we are working on a T3 <-> ORACLE testsystem where we hopefully can solve all problems with templavoila and other major extensions. I would inform you when we are ready (will take some time).

Actions #6

Updated by Karsten Dambekalns almost 17 years ago

I added a fix for this to the SVN version, please give it a try. See #5481 for more info.

Actions #7

Updated by Michael Ablass over 16 years ago

I checked the latest version from http://svn.t3.digitaldistrict.de/cgi-bin/trac.cgi/browser/typo3/TYPO3core/trunk/typo3/sysext/dbal/class.ux_t3lib_db.php?rev=12620 . Unfortunately it doesnt solve the problem for me. Maybe there is a newer version somewhere else?

Actions #8

Updated by Xavier Perseguers over 14 years ago

TemplaVoilà is running properly with TYPO3 4.3 (beta3 at the moment)

Actions #9

Updated by Michael Ablass over 14 years ago

the topic is about templavoila and ORACLE not only templavoila and TYPO3

Actions #10

Updated by Xavier Perseguers over 14 years ago

Michael, I know the topic is about TV and Oracle. What I said is that with TYPO3 4.3 beta3 (now RC1), DBAL was updated and the version 1.0.0 of DBAL should not have this bug anymore when using Oracle.

Mapping of tx_templavoila_datastructure to tx_templavoila_ds still has to be done manually (I'll see whether something semi-automatic may be created for TYPO3 4.4) but the rest should be OK.

Actions #11

Updated by Xavier Perseguers over 14 years ago

Bug with "Ungültiger Zeichnen" may be related to a bug I found today in TV (#12721)

Actions #12

Updated by Xavier Perseguers over 14 years ago

Michael, can you confirm this bug still occurs? If so, could you please post an real example how to reproduce this bug? Because you wrote initially that you had to remap tx_templavoila_datastructure to tx_templavoila_ds (which is a must I admit) but then you want tx_templavoila_tmplobj to be remapped to tx_tv_tmplobj which you did not say you added to the mapping configuration. This mapping is not needed but if present, it should work of course.

As such, please update this bug with your mapping information and today's errors if it still doesn't work. TYPO3 4.3 will be out soon and unless you can show me that this bug still occurs, I'll close this bug as for me TV just works smoothly (unless bug #12721 which is located in TV itself).

Thanks for your patience.

Actions #13

Updated by Michael Ablass over 14 years ago

I cannot confirm if its still occuring in 4.3, but i am quite sure because the problem is
a DBAL and not a TYPO3 core problem. Means: as long the bug exists in DBAL it exists in TYPO3 :).
The DBAL mapping is just not working correct.

These are my localconf settings

$TYPO3_CONF_VARS['EXTCONF']['dbal']['mapping'] = array (

// TemplaVoila
'tx_templavoila_datastructure' => array (
'mapTableName' => 'tx_tv_datastructure',
),
'tx_templavoila_tmplobj' => array (
'mapTableName' => 'tx_tv_tmplobj',
),
);
Actions #14

Updated by Xavier Perseguers over 14 years ago

FYI, this bug will be closed around Christmas - that is in about 2 weeks - if nobody can confirm here that this bug can be reproduced with TYPO3 4.3 and its DBAL version (1.0.2).

A lot of work has been done in the last months on DBAL for the release of TYPO3 4.3.0 and I am running websites with Oracle and TemplaVoilà without having noticed this problem.

Thanks for your understanding.

Actions #15

Updated by Xavier Perseguers over 14 years ago

As already said, lots of work have been done for the release of TYPO3 4.3 and this bug could not be reproduced anymore.

Actions

Also available in: Atom PDF