[TYPO3-mvc] repository add-method does not write to db

Christian Hansen christian at bildungsweb.net
Mon Feb 20 21:16:01 CET 2012


hi there,

i have a problem with some strange behaviour of the repository 
add-method, in same controller, two actions, one time it works, the 
other time no exception is shown, no failed query and nothing is written 
to database.... any ideas around?


This Works:

________________________________________________________________________

/**
  * @param Tx_BwebBe_Domain_Model_Anbieter $anbieter
  * @return void
  */
public function createKopieAction(Tx_BwebBe_Domain_Model_Anbieter 
$anbieter) {
	$anbieterKopie		= t3lib_div::makeInstance(Tx_BwebBe_Domain_Model_Anbieter);
	$anbieterOriginal	= 
$this->anbieterRepository->findByUid($this->getAnbieterID());
	$propertyMapper		= t3lib_div::makeInstance(Tx_Extbase_Property_Mapper);

	// Anbieterdaten an Kopie übergeben
	$propertyMapper->map($this->mapping, $anbieter, $anbieterKopie);

	// Kopie schreiben und Kopie an Original hängen
	$this->anbieterRepository->add($anbieterKopie);
	$anbieterOriginal->setLetzteKopie($anbieterKopie);

	$this->flashMessageContainer->add(Tx_Extbase_Utility_Localization::translate('tx_bwebbe.aenderungenGespeichert', 'bweb_be'));

	// Antwort als JSON, wenn es per AJAX aufgerufen wurde.
	if ($this->ajax === TRUE) {
		return json_encode(array('status' => 'ok'));
	}
}

______________________________________________________________________________


doesn't work:

_____________________________________________________________________________

/**
  * @param Tx_BwebBe_Domain_Model_Anbieter
  * @return void
  */
public function createAction(Tx_BwebBe_Domain_Model_Anbieter $newAnbieter) {

	// Neuer Anbieter bekommt Status in Prüfung
	$newAnbieter->setInPruefung(TRUE);

	$this->anbieterRepository->add($newAnbieter);

	$this->flashMessageContainer->add(Tx_Extbase_Utility_Localization::translate('tx_bwebbe.anbieter.' . $this->getBereich() . '.anlegenOK', 'bweb_be'));
	$this->redirect('show', 'Administrator');
}

_______________________________________________________________________________

No Exception, no sql-error, nothing written do db.

i'm out of ideas...





-- 
Bildungsweb Media GmbH
Christian Hansen | Webdevelopment
TEL 040 - 609400688
http://www.bildungsweb.net | christian at bildungsweb.net


More information about the TYPO3-project-typo3v4mvc mailing list