Page MenuHomePhabricator

D20741.diff
No OneTemporary

D20741.diff

diff --git a/src/applications/transactions/xaction/PhabricatorEditEngineSubtypeTransaction.php b/src/applications/transactions/xaction/PhabricatorEditEngineSubtypeTransaction.php
--- a/src/applications/transactions/xaction/PhabricatorEditEngineSubtypeTransaction.php
+++ b/src/applications/transactions/xaction/PhabricatorEditEngineSubtypeTransaction.php
@@ -25,11 +25,30 @@
}
public function validateTransactions($object, array $xactions) {
- $map = $object->getEngine()
+ $errors = array();
+
+ if (!$xactions) {
+ return $errors;
+ }
+
+ $engine = $object->getEngine();
+
+ if (!$engine->supportsSubtypes()) {
+ foreach ($xactions as $xaction) {
+ $errors[] = $this->newInvalidError(
+ pht(
+ 'Edit engine (of class "%s") does not support subtypes, so '.
+ 'subtype transactions can not be applied to it.',
+ get_class($engine)),
+ $xaction);
+ }
+ return $errors;
+ }
+
+ $map = $engine
->setViewer($this->getActor())
->newSubtypeMap();
- $errors = array();
foreach ($xactions as $xaction) {
$new = $xaction->getNewValue();

File Metadata

Mime Type
text/plain
Expires
Fri, Jan 24, 4:17 AM (15 h, 9 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7038943
Default Alt Text
D20741.diff (1 KB)

Event Timeline