Use temporary negative IDs for rows created in a draft Changeset

This commit is contained in:
2018-08-11 16:19:32 +02:00
parent 7938519a64
commit 8efc31d820
12 changed files with 193 additions and 72 deletions
+4 -1
View File
@@ -79,7 +79,7 @@ class Proposal extends BaseModel
throw new NotApplicableException('No changes to propose.');
}
if ($changeset->note == null) {
if (empty($changeset->note)) {
throw new NotApplicableException('Proposal note must be filled.');
}
@@ -91,6 +91,9 @@ class Proposal extends BaseModel
throw new NotApplicableException('Revision not assigned to Changeset');
}
// Assign unique row IDs to new rows (they use temporary negative IDs in a draft)
$changeset->renumberRows();
return new Proposal([
// relations
'table_id' => $changeset->table->getKey(),