Volle Meldung: Exception while property mapping at property path "": It is not allowed to map property "0". You need to use $propertyMappingConfiguration->allowProperties('0') to enable mapping of this property.
Warum? Und welche Eigenschaft "" soll das sein?
Ich versuche einen Fremdschlüssel zu setzen.
Mein Controller sieht so aus:
protected $ansprechpartnerRepository;
public $behoerdeRepository;
protected $gebaeudeRepository;
/**
* @param AnsprechpartnerRepository $ansprechpartnerRepository
*/
public function injectAnsprechpartnerRepository(AnsprechpartnerRepository $ansprechpartnerRepository) {
$this->ansprechpartnerRepository = $ansprechpartnerRepository;
}
/**
* @param BehoerdeRepository $behoerdeRepository
*/
public function injectBehoerdeRepository(BehoerdeRepository $behoerdeRepository) {
$this->behoerdeRepository = $behoerdeRepository;
}
/**
* @param GebaeudeRepository $gebaeudeRepository
*/
public function injectGebaeudeRepository(GebaeudeRepository $gebaeudeRepository) {
$this->gebaeudeRepository = $gebaeudeRepository;
}
public function listAction() {
$this->view->assign('ansprechpartner', $this->ansprechpartnerRepository->findAll());
}
/**
* @param Ansprechpartner|null $ansprechpartner
*/
public function addFormAction(Ansprechpartner $ansprechpartner = null) {
$behoerde = $this->behoerdeRepository->findAll();
$gebaeude = $this->gebaeudeRepository->findAll();
$this->view->assign('ansprechpartner', $ansprechpartner);
$this->view->assign('behoerde', $behoerde);
$this->view->assign('gebaeude', $gebaeude);
}
/**
* @param Ansprechpartner $ansprechpartner
* @param Behoerde $behoerde
*/
public function addAction(Ansprechpartner $ansprechpartner, Behoerde $behoerde) {
DebuggerUtility::var_dump($behoerde);exit;
}
Das Formular für die addFormAction wird geladen und sieht folgendermaßen aus:
Das Template:
<f:layout name="import"/>
<f:section name="content">
<f:render partial="Ansprechpartner/Form" arguments="{
headline:'Neuen Ansprechpartner anlegen',
action:'add',
submitmessage:'Neuen Ansprechpartner anlegen',
ansprechpartner:ansprechpartner,
behoerde:behoerde,
gebaeude:gebaeude
}"/>
</f:section>
Und das Partial:
<h1>{headline}</h1>
<f:form action="{action}" object="{ansprechpartner}" arguments="{behoerde:behoerde,gebaeude:gebaeude}" name="ansprechpartner" additionalAttributes="{role:'form'}">
<div class="form-group row">
<label>BayBW Id</label>
<f:form.textfield property="baybwId" id="baybwId" type="number" class="form-control"/>
</div>
<div class="form-group row">
<label>Behörde</label>
<f:form.select options="{behoerde}" name="behoerdeId" id="behoerdeId" class="form-control"/>
</div>
<div class="form-group row">
<label>Gebäude</label>
<f:form.select options="{gebaeude}" name="gebaeudeId" id="gebaeudeId" class="form-control"/>
</div>
<f:form.submit value="{submitmessage}" class="btn btn-primary"/>
</f:form>
<!--gekürtzte Fassung-->
Klick ich hier auf den Button für submit bekomme ich die Anfangs genannte Fehlermeldung.
Das Ansprechpartner-Model:
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
/**
* Ansprechpartner
*/
class Ansprechpartner extends AbstractEntity {
/**
* baybwId
*
* @var int
*/
protected $baybwId = 0;
/**
* txKkbaybwGebaeudeId
*
* @var int
*/
protected $txKkbaybwGebaeudeId = 0;
/**
* anredeId
*
* @var int
*/
protected $anredeId = 0;
/**
* vorname
*
* @var string
*/
protected $vorname = '';
/**
* nachname
*
* @var string
*/
protected $nachname = '';
/**
* funktion
*
* @var string
*/
protected $funktion = '';
/**
* stellenbezeichnung
*
* @var string
*/
protected $stellenbezeichnung = '';
/**
* email
*
* @var string
*/
protected $email = '';
/**
* demail
*
* @var string
*/
protected $demail = '';
/**
* website
*
* @var string
*/
protected $website = '';
/**
* zimmer
*
* @var string
*/
protected $zimmer = '';
/**
* sortierreihenfolge
*
* @var int
*/
protected $sortierreihenfolge = 0;
/**
* behoerdeId
*
* @var \KKSoftware\Kkbaybwimport\Domain\Model\Behoerde
*/
protected $behoerdeId = null;
/**
* leistungAnsprechpartner
*
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\KKSoftware\Kkbaybwimport\Domain\Model\Leistung>
*/
protected $leistungAnsprechpartner = null;
/**
* gebaeudeId
*
* @var \KKSoftware\Kkbaybwimport\Domain\Model\Gebaeude
*/
protected $gebaeudeId = null;
/**
* __construct
*/
public function __construct() {
//Do not remove the next line: It would break the functionality
$this->initStorageObjects();
}
/**
* Initializes all ObjectStorage properties
* Do not modify this method!
* It will be rewritten on each save in the extension builder
* You may modify the constructor of this class instead
*
* @return void
*/
protected function initStorageObjects() {
$this->leistungAnsprechpartner = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
}
/**
* Returns the baybwId
*
* @return int $baybwId
*/
public function getBaybwId() {
return $this->baybwId;
}
/**
* Sets the baybwId
*
* @param int $baybwId
* @return void
*/
public function setBaybwId($baybwId) {
$this->baybwId = $baybwId;
}
/**
* Returns the txKkbaybwGebaeudeId
*
* @return int $txKkbaybwGebaeudeId
*/
public function getTxKkbaybwGebaeudeId() {
return $this->txKkbaybwGebaeudeId;
}
/**
* Sets the txKkbaybwGebaeudeId
*
* @param int $txKkbaybwGebaeudeId
* @return void
*/
public function setTxKkbaybwGebaeudeId($txKkbaybwGebaeudeId) {
$this->txKkbaybwGebaeudeId = $txKkbaybwGebaeudeId;
}
/**
* Returns the anredeId
*
* @return int $anredeId
*/
public function getAnredeId() {
return $this->anredeId;
}
/**
* Sets the anredeId
*
* @param int $anredeId
* @return void
*/
public function setAnredeId($anredeId) {
$this->anredeId = $anredeId;
}
/**
* Returns the vorname
*
* @return string $vorname
*/
public function getVorname() {
return $this->vorname;
}
/**
* Sets the vorname
*
* @param string $vorname
* @return void
*/
public function setVorname($vorname) {
$this->vorname = $vorname;
}
/**
* Returns the nachname
*
* @return string $nachname
*/
public function getNachname() {
return $this->nachname;
}
/**
* Sets the nachname
*
* @param string $nachname
* @return void
*/
public function setNachname($nachname) {
$this->nachname = $nachname;
}
/**
* Returns the funktion
*
* @return string $funktion
*/
public function getFunktion() {
return $this->funktion;
}
/**
* Sets the funktion
*
* @param string $funktion
* @return void
*/
public function setFunktion($funktion) {
$this->funktion = $funktion;
}
/**
* Returns the stellenbezeichnung
*
* @return string $stellenbezeichnung
*/
public function getStellenbezeichnung() {
return $this->stellenbezeichnung;
}
/**
* Sets the stellenbezeichnung
*
* @param string $stellenbezeichnung
* @return void
*/
public function setStellenbezeichnung($stellenbezeichnung) {
$this->stellenbezeichnung = $stellenbezeichnung;
}
/**
* Returns the email
*
* @return string $email
*/
public function getEmail() {
return $this->email;
}
/**
* Sets the email
*
* @param string $email
* @return void
*/
public function setEmail($email) {
$this->email = $email;
}
/**
* Returns the demail
*
* @return string $demail
*/
public function getDemail() {
return $this->demail;
}
/**
* Sets the demail
*
* @param string $demail
* @return void
*/
public function setDemail($demail) {
$this->demail = $demail;
}
/**
* Returns the website
*
* @return string $website
*/
public function getWebsite() {
return $this->website;
}
/**
* Sets the website
*
* @param string $website
* @return void
*/
public function setWebsite($website) {
$this->website = $website;
}
/**
* Returns the zimmer
*
* @return string $zimmer
*/
public function getZimmer() {
return $this->zimmer;
}
/**
* Sets the zimmer
*
* @param string $zimmer
* @return void
*/
public function setZimmer($zimmer) {
$this->zimmer = $zimmer;
}
/**
* Returns the sortierreihenfolge
*
* @return int $sortierreihenfolge
*/
public function getSortierreihenfolge() {
return $this->sortierreihenfolge;
}
/**
* Sets the sortierreihenfolge
*
* @param int $sortierreihenfolge
* @return void
*/
public function setSortierreihenfolge($sortierreihenfolge) {
$this->sortierreihenfolge = $sortierreihenfolge;
}
/**
* Returns the behoerdeId
*
* @return \KKSoftware\Kkbaybwimport\Domain\Model\Behoerde $behoerdeId
*/
public function getBehoerdeId() {
return $this->behoerdeId;
}
/**
* Sets the behoerdeId
*
* @param \KKSoftware\Kkbaybwimport\Domain\Model\Behoerde $behoerdeId
* @return void
*/
public function setBehoerdeId(\KKSoftware\Kkbaybwimport\Domain\Model\Behoerde $behoerdeId) {
$this->behoerdeId = $behoerdeId;
}
/**
* Adds a Leistung
*
* @param \KKSoftware\Kkbaybwimport\Domain\Model\Leistung $leistungAnsprechpartner
* @return void
*/
public function addLeistungAnsprechpartner(\KKSoftware\Kkbaybwimport\Domain\Model\Leistung $leistungAnsprechpartner) {
$this->leistungAnsprechpartner->attach($leistungAnsprechpartner);
}
/**
* Removes a Leistung
*
* @param \KKSoftware\Kkbaybwimport\Domain\Model\Leistung $leistungAnsprechpartnerToRemove The Leistung to be removed
* @return void
*/
public function removeLeistungAnsprechpartner(\KKSoftware\Kkbaybwimport\Domain\Model\Leistung $leistungAnsprechpartnerToRemove) {
$this->leistungAnsprechpartner->detach($leistungAnsprechpartnerToRemove);
}
/**
* Returns the leistungAnsprechpartner
*
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\KKSoftware\Kkbaybwimport\Domain\Model\Leistung> $leistungAnsprechpartner
*/
public function getLeistungAnsprechpartner() {
return $this->leistungAnsprechpartner;
}
/**
* Sets the leistungAnsprechpartner
*
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\KKSoftware\Kkbaybwimport\Domain\Model\Leistung> $leistungAnsprechpartner
* @return void
*/
public function setLeistungAnsprechpartner(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $leistungAnsprechpartner) {
$this->leistungAnsprechpartner = $leistungAnsprechpartner;
}
/**
* Returns the gebaeudeId
*
* @return \KKSoftware\Kkbaybwimport\Domain\Model\Gebaeude $gebaeudeId
*/
public function getGebaeudeId() {
return $this->gebaeudeId;
}
/**
* Sets the gebaeudeId
*
* @param \KKSoftware\Kkbaybwimport\Domain\Model\Gebaeude $gebaeudeId
* @return void
*/
public function setGebaeudeId(\KKSoftware\Kkbaybwimport\Domain\Model\Gebaeude $gebaeudeId) {
$this->gebaeudeId = $gebaeudeId;
}
}
Und dann noch das TCA für den Ansprechpartner:
<?php
return [
'ctrl' => [
'title' => 'LLL:EXT:kkbaybwimport/Resources/Private/Language/locallang_db.xlf:tx_kkbaybwimport_domain_model_ansprechpartner',
'label' => 'baybw_id',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'dividers2tabs' => TRUE,
'versioningWS' => 2,
'versioning_followPages' => TRUE,
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'transOrigDiffSourceField' => 'l10n_diffsource',
'delete' => 'deleted',
'enablecolumns' => [
'disabled' => 'hidden',
'starttime' => 'starttime',
'endtime' => 'endtime',
],
'searchFields' => 'baybw_id,tx_kkbaybw_gebaeude_id,anrede_id,vorname,nachname,funktion,stellenbezeichnung,email,demail,website,zimmer,sortierreihenfolge,behoerde_id,leistung_ansprechpartner,gebaeude_id,',
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('kkbaybwimport') . 'Resources/Public/Icons/tx_kkbaybwimport_domain_model_ansprechpartner.gif'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, baybw_id, tx_kkbaybw_gebaeude_id, anrede_id, vorname, nachname, funktion, stellenbezeichnung, email, demail, website, zimmer, sortierreihenfolge, behoerde_id, leistung_ansprechpartner, gebaeude_id',
],
'types' => [
'1' => ['showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1, baybw_id, tx_kkbaybw_gebaeude_id, anrede_id, vorname, nachname, funktion, stellenbezeichnung, email, demail, website, zimmer, sortierreihenfolge, behoerde_id, leistung_ansprechpartner, gebaeude_id, --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access, starttime, endtime'],
],
'palettes' => [
'1' => ['showitem' => ''],
],
'columns' => [
'sys_language_uid' => [
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.language',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'sys_language',
'foreign_table_where' => 'ORDER BY sys_language.title',
'items' => [
['LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages', -1],
['LLL:EXT:lang/locallang_general.xlf:LGL.default_value', 0]
],
],
],
'l10n_parent' => [
'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.l18n_parent',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
['', 0],
],
'foreign_table' => 'tx_kkbaybwimport_domain_model_ansprechpartner',
'foreign_table_where' => 'AND tx_kkbaybwimport_domain_model_ansprechpartner.pid=###CURRENT_PID### AND tx_kkbaybwimport_domain_model_ansprechpartner.sys_language_uid IN (-1,0)',
],
],
'l10n_diffsource' => [
'config' => [
'type' => 'passthrough',
],
],
't3ver_label' => [
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.versionLabel',
'config' => [
'type' => 'input',
'size' => 30,
'max' => 255,
]
],
'hidden' => [
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.hidden',
'config' => [
'type' => 'check',
],
],
'starttime' => [
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.starttime',
'config' => [
'type' => 'input',
'size' => 13,
'max' => 20,
'eval' => 'datetime',
'checkbox' => 0,
'default' => 0,
'range' => [
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
],
],
],
'endtime' => [
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.endtime',
'config' => [
'type' => 'input',
'size' => 13,
'max' => 20,
'eval' => 'datetime',
'checkbox' => 0,
'default' => 0,
'range' => [
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
],
],
],
'baybw_id' => [
'exclude' => 0,
'label' => 'LLL:EXT:kkbaybwimport/Resources/Private/Language/locallang_db.xlf:tx_kkbaybwimport_domain_model_ansprechpartner.baybw_id',
'config' => [
'type' => 'input',
'size' => 4,
'eval' => 'int'
]
],
'tx_kkbaybw_gebaeude_id' => [
'exclude' => 0,
'label' => 'LLL:EXT:kkbaybwimport/Resources/Private/Language/locallang_db.xlf:tx_kkbaybwimport_domain_model_ansprechpartner.tx_kkbaybw_gebaeude_id',
'config' => [
'type' => 'input',
'size' => 4,
'eval' => 'int'
]
],
'anrede_id' => [
'exclude' => 0,
'label' => 'LLL:EXT:kkbaybwimport/Resources/Private/Language/locallang_db.xlf:tx_kkbaybwimport_domain_model_ansprechpartner.anrede_id',
'config' => [
'type' => 'input',
'size' => 4,
'eval' => 'int'
]
],
'vorname' => [
'exclude' => 0,
'label' => 'LLL:EXT:kkbaybwimport/Resources/Private/Language/locallang_db.xlf:tx_kkbaybwimport_domain_model_ansprechpartner.vorname',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'nachname' => [
'exclude' => 0,
'label' => 'LLL:EXT:kkbaybwimport/Resources/Private/Language/locallang_db.xlf:tx_kkbaybwimport_domain_model_ansprechpartner.nachname',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'funktion' => [
'exclude' => 0,
'label' => 'LLL:EXT:kkbaybwimport/Resources/Private/Language/locallang_db.xlf:tx_kkbaybwimport_domain_model_ansprechpartner.funktion',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'stellenbezeichnung' => [
'exclude' => 0,
'label' => 'LLL:EXT:kkbaybwimport/Resources/Private/Language/locallang_db.xlf:tx_kkbaybwimport_domain_model_ansprechpartner.stellenbezeichnung',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'email' => [
'exclude' => 0,
'label' => 'LLL:EXT:kkbaybwimport/Resources/Private/Language/locallang_db.xlf:tx_kkbaybwimport_domain_model_ansprechpartner.email',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'demail' => [
'exclude' => 0,
'label' => 'LLL:EXT:kkbaybwimport/Resources/Private/Language/locallang_db.xlf:tx_kkbaybwimport_domain_model_ansprechpartner.demail',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'website' => [
'exclude' => 0,
'label' => 'LLL:EXT:kkbaybwimport/Resources/Private/Language/locallang_db.xlf:tx_kkbaybwimport_domain_model_ansprechpartner.website',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'zimmer' => [
'exclude' => 0,
'label' => 'LLL:EXT:kkbaybwimport/Resources/Private/Language/locallang_db.xlf:tx_kkbaybwimport_domain_model_ansprechpartner.zimmer',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
],
],
'sortierreihenfolge' => [
'exclude' => 0,
'label' => 'LLL:EXT:kkbaybwimport/Resources/Private/Language/locallang_db.xlf:tx_kkbaybwimport_domain_model_ansprechpartner.sortierreihenfolge',
'config' => [
'type' => 'input',
'size' => 4,
'eval' => 'int'
]
],
'behoerde_id' => [
'exclude' => 1,
'label' => 'LLL:EXT:kkbaybwimport/Resources/Private/Language/locallang_db.xlf:tx_kkbaybwimport_domain_model_ansprechpartner.behoerde_id',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'tx_kkbaybwimport_domain_model_behoerde',
'minitems' => 0,
'maxitems' => 1,
],
],
'leistung_ansprechpartner' => [
'exclude' => 1,
'label' => 'LLL:EXT:kkbaybwimport/Resources/Private/Language/locallang_db.xlf:tx_kkbaybwimport_domain_model_ansprechpartner.leistung_ansprechpartner',
'config' => [
'type' => 'select',
'renderType' => 'selectMultipleSideBySide',
'foreign_table' => 'tx_kkbaybwimport_domain_model_leistung',
'MM' => 'tx_kkbaybwimport_ansprechpartner_leistung_mm',
'size' => 10,
'autoSizeMax' => 30,
'maxitems' => 9999,
'multiple' => 0,
'wizards' => [
'_PADDING' => 1,
'_VERTICAL' => 1,
'edit' => [
'module' => [
'name' => 'wizard_edit',
],
'type' => 'popup',
'title' => 'Edit',
'icon' => 'edit2.gif',
'popup_onlyOpenIfSelected' => 1,
'JSopenParams' => 'height=350,width=580,status=0,menubar=0,scrollbars=1',
],
'add' => [
'module' => [
'name' => 'wizard_add',
],
'type' => 'script',
'title' => 'Create new',
'icon' => 'add.gif',
'params' => [
'table' => 'tx_kkbaybwimport_domain_model_leistung',
'pid' => '###CURRENT_PID###',
'setValue' => 'prepend'
],
],
],
],
],
'gebaeude_id' => [
'exclude' => 1,
'label' => 'LLL:EXT:kkbaybwimport/Resources/Private/Language/locallang_db.xlf:tx_kkbaybwimport_domain_model_ansprechpartner.gebaeude_id',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'tx_kkbaybwimport_domain_model_gebaeude',
'minitems' => 0,
'maxitems' => 1,
],
],
],
];
Ich versuche das jetzt seit Freitag und komme keinen Schritt weiter. Kann mir jemand behilflich sein?