admin管理员组文章数量:1419223
TYPO3 v11
There is an external database configured:
'DB' => [ 'Connections' => [ 'MyDatabase' => [ 'charset' => 'utf8', 'dbname' => 'mydatabase', 'driver' => 'mysqli', 'host' => '127.0.0.1', 'password' => 'xxx', 'port' => 3336, 'user' => 'myuser', ], 'Default' => [ 'charset' => 'utf8', 'dbname' => 'typo3database', 'driver' => 'mysqli', 'host' => '127.0.0.1', 'password' => 'xxx', 'port' => 3306, 'user' => 'typo3user', ], ], 'TableMapping' => [ 'initiatives' => 'MyDatabase', 'municipalities' => 'MyDatabase', ], ]
Extbase table mapping is configured in Configuration/Extbase/Persistence/Classes.php
:
return [
\MyVendor\MyExt\Domain\Model\Initiative::class => [
'tableName' => 'initiatives',
'properties' => [
'uid' => [
'fieldName' => 'id'
]
]
],
\MyVendor\MyExt\Domain\Model\Municipality::class => [
'tableName' => 'municipalities',
'properties' => [
'uid' => [
'fieldName' => 'id'
]
]
]
];
A plugin is configured in ext_localconf.php
:
use MyVendor\MyExt\Controller\InitiativeController;
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'MyExt',
'List',
array(
InitiativeController::class => 'list,show',
),
// non-cacheable actions
array(
InitiativeController::class => 'list,show',
)
);
Everything works fine for the plugin, but: When I try to delete a page I get an error message:
(1/3) Doctrine\DBAL\Exception\InvalidFieldNameException
An exception occurred while executing 'SELECT `uid` FROM `initiatives`
WHERE `pid` = ? ORDER BY `uid` ASC' with params [14535]:
Unknown column 'uid' in 'field list'
The external database doesn't use uid
but id
instead. DBAL cannot map this. That is why this error occurs. But why the external table is queried at all? It is just a simple TYPO3 page which should be deleted!
Is there a misconfiguration somewehre, or is something missing one my side?
TYPO3 v11
There is an external database configured:
'DB' => [ 'Connections' => [ 'MyDatabase' => [ 'charset' => 'utf8', 'dbname' => 'mydatabase', 'driver' => 'mysqli', 'host' => '127.0.0.1', 'password' => 'xxx', 'port' => 3336, 'user' => 'myuser', ], 'Default' => [ 'charset' => 'utf8', 'dbname' => 'typo3database', 'driver' => 'mysqli', 'host' => '127.0.0.1', 'password' => 'xxx', 'port' => 3306, 'user' => 'typo3user', ], ], 'TableMapping' => [ 'initiatives' => 'MyDatabase', 'municipalities' => 'MyDatabase', ], ]
Extbase table mapping is configured in Configuration/Extbase/Persistence/Classes.php
:
return [
\MyVendor\MyExt\Domain\Model\Initiative::class => [
'tableName' => 'initiatives',
'properties' => [
'uid' => [
'fieldName' => 'id'
]
]
],
\MyVendor\MyExt\Domain\Model\Municipality::class => [
'tableName' => 'municipalities',
'properties' => [
'uid' => [
'fieldName' => 'id'
]
]
]
];
A plugin is configured in ext_localconf.php
:
use MyVendor\MyExt\Controller\InitiativeController;
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'MyExt',
'List',
array(
InitiativeController::class => 'list,show',
),
// non-cacheable actions
array(
InitiativeController::class => 'list,show',
)
);
Everything works fine for the plugin, but: When I try to delete a page I get an error message:
(1/3) Doctrine\DBAL\Exception\InvalidFieldNameException
An exception occurred while executing 'SELECT `uid` FROM `initiatives`
WHERE `pid` = ? ORDER BY `uid` ASC' with params [14535]:
Unknown column 'uid' in 'field list'
The external database doesn't use uid
but id
instead. DBAL cannot map this. That is why this error occurs. But why the external table is queried at all? It is just a simple TYPO3 page which should be deleted!
Is there a misconfiguration somewehre, or is something missing one my side?
Share Improve this question asked Jan 29 at 16:37 Stefan PadbergStefan Padberg 5272 silver badges20 bronze badges1 Answer
Reset to default 0I gave up the idea of mapping the external database into the TYPO3 system. As the external database does not work with 'uid' the DBAL data mapping is not functioning properly. There seems to be no way as the 'uid' column is absolutely needed. All other columns can be mapped, but this one not.
本文标签: dbalTYPO3 with external database throws error when deleting pagesStack Overflow
版权声明:本文标题:dbal - TYPO3 with external database throws error when deleting pages - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745289806a2651723.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论