我有TYPO3 7.6.18版本。TYPO3 ObjectStorage不保存數據
我無法從前端保存下拉字段,在後端保存。
我TCA:
'眼鏡'=>數組( '標籤'=> 'LLL:EXT:feusersplus /資源/私人/語言/ locallang_db.xlf:tx_feusersplus_domain_model_user.glasses', '配置' =>數組( '類型'=> '選擇', 'renderType'=> 'selectMultipleSideBySide', 'foreign_table'=> 'tx_feusersplus_domain_model_glasses', 'MM'=> 'tx_feusersplus_user_glasses_mm', 'foreign_table_where'=> 'AND tx_feusersplus_domain_model_glasses.sys_language_uid = ### REC_FIELD_sys_language_uid ###', 'maxitems'=>'50' ), ),
型號:
/**
* glasses
*
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Fhk\Feusersplus\Domain\Model\Glasses>
*
*/
protected $glasses;
/**
* Returns the glasses
*
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Fhk\Feusersplus\Domain\Model\Glasses> $glasses
*/
public function getGlasses()
{
return $this->glasses;
}
/**
* Sets the glasses
*
* @return void
*/
public function setGlasses($glasses)
{
$this->glasses = $glasses;
}
我的觀點:
{namespace femanager=Fhk\Feusersplus\ViewHelpers}
<f:render section="default" arguments="{_all}" />
<f:section name="default">
<div class="femanager_fieldset femanager_glasses control-group">
<label for="femanager_field_glasses" class="control-label">
<f:translate key="tx_feusersplus.glasses"/>
<f:if condition="{femanager:Validation.IsRequiredField(fieldName:'glasses')}">
<span>*</span>
</f:if>
</label>
<div class="controls">
<femanager:form.select
id="femanager_field_glasses"
property="glasses"
options="{femanager:Form.GetGlasses()}"
class="input-block-level"
additionalAttributes="{femanager:Validation.FormValidationData(settings:settings,fieldName:'glasses')}" />
</div>
</div>
</f:section>
真的,我試過很多變種。清除所有緩存。它不適用於後端。幫我請人),但這並沒有節省前端
這是行不通的(( – Mikael
我按照你的說法添加了代碼,我發現它在fe_users表中的field眼鏡中設置了glasses = 0,並且它沒有將行添加到glasses_mm表中 – Mikael
它從glasses_mm中刪除行,但是不添加行到這張表((你能幫忙,請 – Mikael