Commit 8fbc62c1 authored by Carsten  Rose's avatar Carsten Rose
Browse files

#3533 / afterSave: sqlUpdate auf child-record ändert xId von Hauptrecord auf 0

Unit Test angepasst und erweitert.
ext_emconf.php: minor version tag incremented
parent abb54832
......@@ -10,5 +10,5 @@ $EM_CONF[$_EXTKEY] = array(
'dependencies' => 'fluid,extbase',
'clearcacheonload' => true,
'state' => 'alpha',
'version' => '0.16.1'
'version' => '0.16.2'
);
\ No newline at end of file
......@@ -251,7 +251,6 @@ class FormActionTest extends \AbstractDatabaseTest {
$feSpecAction[FE_TYPE] = FE_TYPE_AFTER_SAVE;
$feSpecAction[FE_SQL_INSERT] = "{{ INSERT INTO Address (city, personId) VALUES ('invalid', {{r}}) }} ";
$feSpecAction[FE_SQL_UPDATE] = "{{ UPDATE Address SET city='Uptown' WHERE id={{slaveId:V}} }} ";
// $feSpecAction[FE_SQL_DELETE] = "{{ DELETE FROM Address WHERE personId={{r}} AND id=0 }} ";
$result = $this->db->sql("TRUNCATE Address");
$result = $this->db->sql("INSERT INTO Address (city, personId) VALUES ('Downtown1', 1)");
......@@ -287,8 +286,23 @@ class FormActionTest extends \AbstractDatabaseTest {
$result = $this->db->sql("SELECT id, city, personId FROM Address WHERE personId=$masterId", ROW_IMPLODE_ALL);
$this->assertEquals('3Uptown' . $masterId, $result);
// Check updated primary record: person.adrId
$result = $this->db->sql("SELECT id, name, adrId FROM Person WHERE id=$masterId", ROW_IMPLODE_ALL);
$this->assertEquals('2Smith3', $result);
// Same situation as above, with sqlDelete.
$feSpecAction[FE_SQL_DELETE] = "{{ DELETE FROM Address WHERE id={{slaveId}} }} ";
$formAction->elements($masterId, [$feSpecAction], FE_TYPE_AFTER_SAVE);
$result = $this->db->sql("SELECT id, city, personId FROM Address WHERE personId=$masterId", ROW_IMPLODE_ALL);
$this->assertEquals('', $result);
// Check updated primary record: person.adrId
$result = $this->db->sql("SELECT id, name, adrId FROM Person WHERE id=$masterId", ROW_IMPLODE_ALL);
$this->assertEquals('2Smith0', $result);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment