[Flow] delete language version in Controller
Christian Ehret
ce at toco3.com
Mon Sep 28 01:35:47 CEST 2015
Hello,
I'm creating a special kind of "frontend editing" of records. I'm on TYPO3 6.2
My first problem was to display the translated records but with the "patch" described here, I got this working: forge.typo3.org/issues/45873#note-27
My next problem is, that the feuser should be able to delete a localized version of the record. Repository->remove does not work with localized records. If I remove a localized record the deleted flag is set on the parent (sys_lanuage_uid = 0) record. So I added deleted to my model und tried to set Repository->setDeleted(true); but the deleted flag is not set (I can set other properties - even hidden - but not deleted).
So I tried to implement my own delete Method:
public function deleteRecord($uid) {
$query = $this->createquery();
$query->getQuerySettings()->setReturnRawQueryResult(TRUE);
$sql = 'UPDATE tx_toco3records_domain_model_mytable SET deleted=1 WHERE uid='.$uid;
$query->statement($sql);
$result = $query->execute();
return $result;
}
It is working (the deleted flag is set) but I get this error:
Fatal error: Call to a member function fetch_assoc() on a non-object in /var/www//typo3_src-6.2.14/typo3/sysext/core/Classes/Database/DatabaseConnection.php on line 1038
If I do not set the setReturnRawQueryResult to true, I do not get any error but the deleted flag is not set :-(
Any ideas?
Thank you
Christian
More information about the Flow
mailing list