Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14762022
D20741.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D20741.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D20741: Fix incorrect construction of subtype map when validating "subtype" transactions against non-subtypable objects
Attached
Detach File
Event Timeline
Log In to Comment