Restore "Create" transactions

Summary:
Ref T10004. This restores "alice created this task." transactions, but in a generic way so we don't have to special case one of the other edits with an old `null` value.

In most cases, creating an object now shows only an "alice created this thing." transaction, unless nonempty defaults (usually, policy or spaces) were adjusted.

Test Plan: Created pastes, tasks, blogs, packages, and forms. Saw a single "alice created this thing." transaction.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10004

Differential Revision: https://secure.phabricator.com/D14820
This commit is contained in:
epriestley
2015-12-18 10:14:37 -08:00
parent 7168d8edd9
commit 5cb0de1efc
9 changed files with 69 additions and 3 deletions

View File

@@ -24,7 +24,9 @@ final class PhameBlogTransaction
$old = $this->getOldValue();
switch ($this->getTransactionType()) {
case self::TYPE_DESCRIPTION:
return ($old === null);
if ($old === null) {
return true;
}
}
return parent::shouldHide();
}
@@ -98,6 +100,10 @@ final class PhameBlogTransaction
$type = $this->getTransactionType();
switch ($type) {
case PhabricatorTransactions::TYPE_CREATE:
return pht(
'%s created this blog.',
$this->renderHandleLink($author_phid));
case self::TYPE_NAME:
if ($old === null) {
return pht(