[TYPO3-mvc] I'm too stupid for repository->add?

Manfred Rutschmann manfred.rutschmann at revier.de
Tue Nov 30 08:21:28 CET 2010


Hi List,

im not sure what is my problem, but i can`t add new domain models to the
repository. That`s really incredible this morning... 

I have a little form:

<f:form name="user" method="post" object="{user}" controller="Download"
action="formsend">
	<f:form.textbox name="firstname" property="firstname" />
	<f:form.textbox name="street" property="street" />
	<f:form.submit value="Senden" />
</f:form>

This form redirects to the formsendAction. Validation of my model is fine,
no problems here. When i look in my formsend in the $user object that is
transmitted all is fine. But this code does nothing:

/**
 * formsendAction
 * @param Tx_MrGwdownload_Domain_Model_User $user
 * @return string The rendered formindex action
 */
public function formsendAction(Tx_MrGwdownload_Domain_Model_User $user){
	//print_r($user);
	$this->userRepository->add($user);
	$persistenceManager =
t3lib_div::makeInstance('Tx_Extbase_Persistence_Manager');
	$persistenceManager->persistAll();
	//$this->redirect("dlshow","Download",NULL,array('user'=>$user),29);
}

No entry in my table... nothing. I have set the storagePid via TS:

plugin.tx_mrgwdownload {
    persistence {
        storagePid = 27
    }
}
 Cache is cleared... Over my typo3 backend i can create new database
entries of this type, so i think with tca and the other files is all ok. i
used the extbase kickstarter for the basic setup. I had a second domain
model. There i have the same problem. I can test this one in my controllers
initializeAction the keep out some redirect errors between the actions this
way:

/**
 * Start the initalizing action. Setup all needed parts for this extension
 * @return void
 */
public function initializeAction(){
	// Start the retailer repsoitory
	$this->retailerRepository = new
Tx_MrGwdownload_Domain_Repository_RetailerRepository;
	// start the user repository
	$this->userRepository = new
Tx_MrGwdownload_Domain_Repository_UserRepository;
	
	$user = new Tx_MrGwdownload_Domain_Model_User;
	$user->setFirstname("Test");
	$this->userRepository->add($user);
	$pm = t3lib_div::makeInstance("Tx_Extbase_Persistence_Manager");
	$pm->persistAll();
}

But no data is saved in my table over the repo.

Any ideas what`s going wrong here?

Thanks and regards
Manne


More information about the TYPO3-project-typo3v4mvc mailing list