Project

General

Profile

Actions

Bug #78944

closed

TCE throws wrong exception with overlay table

Added by Franz Holzinger almost 8 years ago. Updated almost 8 years ago.

Status:
Rejected
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2016-12-09
Due date:
% Done:

0%

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

Description

If I create a new record of a language overlay record in the List Module, then the exception 1470742770 is thrown. I use the table products in alternative language (tt_products_language).

Uncaught TYPO3 Exception
#1470742770: The given value for the original language field prod_uid of table tt_products_language contains an invalid value. (More information)

InvalidArgumentException thrown in file
/var/www/html/typo3_src-7.6.14/typo3/sysext/backend/Classes/Form/Container/SingleFieldContainer.php in line 84.

16 TYPO3\CMS\Backend\Form\Container\SingleFieldContainer::render()

/var/www/html/typo3_src-7.6.14/typo3/sysext/backend/Classes/Form/Container/PaletteAndSingleContainer.php:

00134:
00135:                 $options['renderType'] = 'singleFieldContainer';

00136:                 $childResultArray = $this->nodeFactory->create($options)->render();

00137:
00138:                 if (!empty($childResultArray['html'])) {

15 TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer::render()

/var/www/html/typo3_src-7.6.14/typo3/sysext/backend/Classes/Form/Container/NoTabsContainer.php:

00032:         $options = $this->data;
00033:         $options['renderType'] = 'paletteAndSingleContainer';

00034:         $resultArray = $this->nodeFactory->create($options)->render();

00035:         $resultArray['html'] = '<div class="tab-content">' . $resultArray['html'] . '</div>';
00036:         return $resultArray;

14 TYPO3\CMS\Backend\Form\Container\NoTabsContainer::render()

/var/www/html/typo3_src-7.6.14/typo3/sysext/backend/Classes/Form/Container/FullRecordContainer.php:

00082:         }
00083:

00084:         return $this->nodeFactory->create($data)->render();

00085:     }
00086:

13 TYPO3\CMS\Backend\Form\Container\FullRecordContainer::render()

/var/www/html/typo3_src-7.6.14/typo3/sysext/backend/Classes/Form/Container/OuterWrapContainer.php:

00051:             $options['renderType'] = 'listOfFieldsContainer';
00052:         }

00053:         $result = $this->nodeFactory->create($options)->render();

00054:
00055:         $childHtml = $result['html'];

12 TYPO3\CMS\Backend\Form\Container\OuterWrapContainer::render()

/var/www/html/typo3_src-7.6.14/typo3/sysext/backend/Classes/Controller/EditDocumentController.php:

01199:
01200:                                 $formData['renderType'] = 'outerWrapContainer';

01201:                                 $formResult = $nodeFactory->create($formData)->render();

01202:
01203:                                 $html = $formResult['html'];

11 TYPO3\CMS\Backend\Controller\EditDocumentController::makeEditForm()

/var/www/html/typo3_src-7.6.14/typo3/sysext/backend/Classes/Controller/EditDocumentController.php:

01007:             }
01008:             // Creating the editing form, wrap it with buttons, document selector etc.

01009:             $editForm = $this->makeEditForm();

01010:             if ($editForm) {
01011:                 $this->firstEl = reset($this->elementsData);

10 TYPO3\CMS\Backend\Controller\EditDocumentController::main()

/var/www/html/typo3_src-7.6.14/typo3/sysext/backend/Classes/Controller/EditDocumentController.php:

02041:
02042:         $this->init();

02043:         $this->main();

02044:
02045:         $response->getBody()->write($this->moduleTemplate->renderContent());

9 TYPO3\CMS\Backend\Controller\EditDocumentController::mainAction(TYPO3\CMS\Core\Http\ServerRequest, TYPO3\CMS\Core\Http\Response)

8 call_user_func_array(array, array)

/var/www/html/typo3_src-7.6.14/typo3/sysext/backend/Classes/Http/RouteDispatcher.php:

00052:         $targetIdentifier = $route->getOption('target');
00053:         $target = $this->getCallableFromTarget($targetIdentifier);

00054:         return call_user_func_array($target, [$request, $response]);

00055:     }
00056:

7 TYPO3\CMS\Backend\Http\RouteDispatcher::dispatch(TYPO3\CMS\Core\Http\ServerRequest, TYPO3\CMS\Core\Http\Response)

/var/www/html/typo3_src-7.6.14/typo3/sysext/backend/Classes/Http/RequestHandler.php:

00166:         /** @var RouteDispatcher $dispatcher */
00167:         $dispatcher = GeneralUtility::makeInstance(RouteDispatcher::class);

00168:         return $dispatcher->dispatch($request, $response);

00169:     }
00170: }

6 TYPO3\CMS\Backend\Http\RequestHandler::dispatch(TYPO3\CMS\Core\Http\ServerRequest)

/var/www/html/typo3_src-7.6.14/typo3/sysext/backend/Classes/Http/RequestHandler.php:

00093:         if ($routingEnabled) {
00094:             try {

00095:                 return $this->dispatch($request);

00096:
00097:                 // When token was invalid redirect to login

5 TYPO3\CMS\Backend\Http\RequestHandler::handleRequest(TYPO3\CMS\Core\Http\ServerRequest)

/var/www/html/typo3_src-7.6.14/typo3/sysext/core/Classes/Core/Bootstrap.php:

00300:
00301:         // Execute the command which returns a Response object or NULL

00302:         $this->response = $requestHandler->handleRequest($request);

00303:         return $this;
00304:     }

4 TYPO3\CMS\Core\Core\Bootstrap::handleRequest(TYPO3\CMS\Core\Http\ServerRequest)

/var/www/html/typo3_src-7.6.14/typo3/sysext/backend/Classes/Http/Application.php:

00092:         }
00093:

00094:         $this->bootstrap->handleRequest($this->request);

00095:
00096:         if ($execute !== null) {

3 TYPO3\CMS\Backend\Http\Application::run()

/var/www/html/typo3_src-7.6.14/typo3/index.php:

00018: call_user_func(function () {
00019:     $classLoader = require __DIR__ . '/../vendor/autoload.php';

00020:     (new \TYPO3\CMS\Backend\Http\Application($classLoader))->run();

00021: });

2 {closure}()

1 call_user_func(Closure)

/var/www/html/typo3_src-7.6.14/typo3/index.php:

00019:     $classLoader = require __DIR__ . '/../vendor/autoload.php';
00020:     (new \TYPO3\CMS\Backend\Http\Application($classLoader))->run();

00021: });

Bugfix:

Remove these lines from file /var/www/html/typo3_src-7.6.14/typo3/sysext/backend/Classes/Form/Container/SingleFieldContainer.php:

} else {
    throw new \InvalidArgumentException('The given value for the original language field '
    . $this->data['processedTca']['ctrl']['transOrigPointerField']
    . ' of table ' . $table . ' contains an invalid value.', 1470742770);

debug info:

$parentValue: ''
$fieldName: sys_language_uid

$row:

pid    
Integer
4
uid    NEW584afa2eb8c6c331249163
t3ver_label    
sys_language_uid    
Array
sorting    
hidden    0
tstamp    0
crdate    0
starttime    0
endtime    0
fe_group    
Array
prod_uid    
title    
subtitle    
keyword    
itemnumber    
unit    
note    
note2    
smallimage    
image_uid    

Actions #1

Updated by Christian Kuhn almost 8 years ago

Franz, your configuration for tt_products with tt_products_language is invalid. The combination of transOrigPointerField with transOrigPointerTable always only worked properly with pages table.

Maybe you recognized that the element browser, the list module and the data handler have severe issues with 'transOrigPointerTable' in multi language setups. Those issues and a lot more where in the core since that "have language overlays in different table" feature was introduced with 4.0.

The core now throws exceptions in such situations in v7, this will stay. In v8, the 'transOrigPointerTable' was entirely dropped from TCA. Maybe still in v8, or in v9 latest "pages_language_overlay" will be merged to "pages" to get rid of that usage, see https://review.typo3.org/#/c/50819/9/typo3/sysext/core/Documentation/Changelog/master/Breaking-78191-RemoveSupportForTransForeignTableInTCA.rst for more details on a preparation for this. Will be released with core 8.5 in two weeks.

Please start upgrading your codebase to go away from this concept, v8 even actively removes that flag from TCA.

Actions #2

Updated by Christian Kuhn almost 8 years ago

  • Status changed from New to Rejected
Actions

Also available in: Atom PDF