[TYPO3-core] RFC: Bug #0007295: Bogus check in handler_getFromTableList
Michael Stucki
michael at typo3.org
Sun Feb 3 08:55:02 CET 2008
Hi Oliver,
> Problem:
> There is an uninitialized variable used for a check, causing the check
> condition to never trigger.
>
> Solution:
> Remove the bogus check and clean up that part of the code.
I disagree. This is the old code:
- // Find handler key, select "_DEFAULT" if none is specifically configured:
- $handlerKey = $this->table2handlerKeys[$vArray['table']] ? $this->table2handlerKeys[$vArray['table']] : '_DEFAULT';
-
- // In case of separate handler keys for joined tables:
- if ($outputHandlerKey && $handlerKey != $outputHandlerKey) {
- die('DBAL fatal error: Tables in this list "'.$tableList.'" didn\'t use the same DB handler!');
- }
-
- $outputHandlerKey = $handlerKey;
+ // Find handler key, select "_DEFAULT" if none is specifically configured:
+ $outputHandlerKey = $this->table2handlerKeys[$vArray['table']] ? $this->table2handlerKeys[$vArray['table']] : '_DEFAULT';
So the check seems just fine: If $outputHandlerKey is not set, it is also not
compared. I did not check this, but if my assumption is wrong, then the
problem description is probably the same...
> References:
> http://bugs.typo3.org/view.php?id=7295
>
> Branch: Trunk
Two notes about code cleanup:
- Comments are always indented by a tab, so please don't change this.
- Whenever you do whitespace-cleanup, make sure to add two patches: a
complete one, and another one with diff calling the "-w" switch (ignores
whitespace-changes). This makes it easier to review such patches...
Regards, michael
--
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/
More information about the TYPO3-team-core
mailing list