gpt4 book ai didi

php - 扩展构建器中的 "Map to existing tables"在 TYPO3 中显示奇怪的问题

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:38:50 27 4
gpt4 key购买 nike

在我的扩展 MyExt 中,我将模型 Page 映射到 TYPO3 中的 pages 表。首先,它向我显示了 type mismatch 错误,无论如何我还是继续并保存了它。

会发生以下情况:

  • 我的页面树变成了这样:

enter image description here

  • 我的新记录表只显示 UID,不显示标题:

enter image description here

  • 我的页面编辑变成这样: enter image description here

在我的 MyExt/Configuration/TypoScript/setup.txt 中我有这个:

config.tx_extbase.persistence.classes {
Tx_MyExt_Domain_Model_Page {
mapping {
tableName = pages
}
}
}

这是一个错误吗?或者我做错了什么?

这是我的 /Domain/Model/Page.php ,只是一瞥。

class Page extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{

/**
* uid
* @var int
* @validate NotEmpty
*/
protected $uid;

/**
* title
* @var string
* @validate NotEmpty
*/
protected $title;

/**
* __construct
*
* @return Page
*/
public function __construct() {
//Do not remove the next line: It would break the functionality
$this->initStorageObjects();
}

/**
* Returns the title
*
* @return string $title
*/
public function getTitle(){
return $this->title;
}

}

我的 /Domain/Repository/PageRepository.php

class PageRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {

}

最佳答案

只需从文件 my_ext/ext_tables.php 中删除整个 $TCA['pages'] 部分,或将其注释掉。

如果设置,它将使用您的扩展中的值覆盖 TYPO3 核心中的大多数默认 TCA 设置。您可能不需要为此进行自定义设置。

关于php - 扩展构建器中的 "Map to existing tables"在 TYPO3 中显示奇怪的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17962619/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com