[TYPO3-mvc] Objects created through eID action remain empty

Daniel Völkel d.voelkel at medienwuerfel.de
Sun Aug 24 11:19:06 CEST 2014


Hi guys,

I'm actually updating an extension from 4.7 to 6.2 which went pretty well so far. Now I encountered a massive problem which I couldn't solve - hopefully you can give me some advise.

In my extension, there es is a list of language independent offers, created through different users in FE. Within the list of offers, users can save offers to their own list of favorites to access them later again. This saving action is called through an ajax script with eID. 

This worked pretty without problems in 4.7 but now creates a database entry with all fields besides the PageID set to 0 / NULL. Also debugging the object with \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($request); has the correct information. If I'm updating an existing object in the database, all values are correctly saved.

eID-Dispatcher: 
http://t3-developer.com/extbase-fluid/extensions-erweitern/ajax-in-extensions/ajax-dispatcher-eid-in-typo3-61/

ajax-Call:

jQuery('#list').on('click', '.details', function(e) {
	e.preventDefault();
	jQuery.ajax({
		url: 'index.php',
		method: 'post',
		params:{}, 
		data: {
			eID: 'ajax',  
			request: {  
				pluginName:  'pi1',
				controller:  'Anfrage',
				action:      'requestAngebot,				
				arguments :{                       
					'angebot': jQuery(this).attr('data-uid')
				}
			}
		},	
		cache: false,				
		dataType: 'json'				
	});	// end ajax call		
});




requestAction:

public function requestAngebotZimmerAction() {

	$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager');
	
	$this->roleRepository = $this->objectManager->get('MW\Serviceportal\Domain\Repository\RoleRepository');		
	$this->angebotRepository = $this->objectManager->get('MW\Serviceportal\Domain\Repository\AngebotRepository');	
	$this->anfrageRepository = $this->objectManager->get('MW\Serviceportal\Domain\Repository\AnfrageRepository');	

	$angebot = $this->angebotRepository->findByUid($this->request->getArgument('angebot'));
			
	$anfrage = new \MW\Serviceportal\Domain\Model\Anfrage;	
	$anfrage->setDate(new \DateTime('NOW'));
	$anfrage->setRole($this->roleRepository->findActiveRole());
	$anfrage->setAngebot($angebot);	

	$this->anfrageRepository->add($anfrage);
	$angebot->addAnfrage($anfrage);
									
	$this->objectManager->get('TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface')->persistAll();
	
	$reqArray = array();
	$reqArray['requestText'] = "Ihre Anfrage wurde gespeichert.";
	return json_encode($reqArray);
}


Do you have any idea how this problem could be solved? Could it be based on the language indepence of all objects?

Best regards,
Dan


More information about the TYPO3-project-typo3v4mvc mailing list