[TYPO3-mvc] enable fields

Philipp Wrann philippwrann at gmail.com
Mon Apr 20 18:56:52 CEST 2015


You can use a initializeConfirmDeleteAction to manipulate the TCA temporary. Same goes for deleteAction and initializeDeleteAction

Alternatively you can pass the plain uid as parameter (no magic reconstitution from persistence) and do something like:

/**
* @param integer $object
*/
public function confirmDeleteAction($object) {
$query = $this->repository->createQuery();
$query->getQuerySettings()->setRespectEnableFields(FALSE);
$objectToDelete = $query->matching($query->equals('uid',$object))->execute()->getFirst();
if ($objectToDelete !== NULL) {
$this->repository->remove($objectToDelete); // or delete? cant remember
$this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::class)->persistAll(); // php 5.5 syntax, you may have use the a string as classname
}
// add flash message
// redirect to index/list
}


More information about the TYPO3-project-typo3v4mvc mailing list