Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15319395
D16474.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
D16474.diff
View Options
diff --git a/src/applications/paste/query/PhabricatorPasteQuery.php b/src/applications/paste/query/PhabricatorPasteQuery.php
--- a/src/applications/paste/query/PhabricatorPasteQuery.php
+++ b/src/applications/paste/query/PhabricatorPasteQuery.php
@@ -173,6 +173,7 @@
'P'.$paste->getID(),
$paste->getFilePHID(),
$paste->getLanguage(),
+ PhabricatorHash::digestForIndex($paste->getTitle()),
));
}
@@ -184,6 +185,7 @@
$paste->getFilePHID(),
$paste->getLanguage(),
'snippet',
+ PhabricatorHash::digestForIndex($paste->getTitle()),
));
}
diff --git a/src/applications/paste/xaction/PhabricatorPasteLanguageTransaction.php b/src/applications/paste/xaction/PhabricatorPasteLanguageTransaction.php
--- a/src/applications/paste/xaction/PhabricatorPasteLanguageTransaction.php
+++ b/src/applications/paste/xaction/PhabricatorPasteLanguageTransaction.php
@@ -13,12 +13,20 @@
$object->setLanguage($value);
}
+ private function renderLanguageValue($value) {
+ if (!strlen($value)) {
+ return $this->renderValue(pht('autodetect'));
+ } else {
+ return $this->renderValue($value);
+ }
+ }
+
public function getTitle() {
return pht(
"%s updated the paste's language from %s to %s.",
$this->renderAuthor(),
- $this->renderOldValue(),
- $this->renderNewValue());
+ $this->renderLanguageValue($this->getOldValue()),
+ $this->renderLanguageValue($this->getNewValue()));
}
public function getTitleForFeed() {
@@ -26,8 +34,8 @@
'%s updated the language for %s from %s to %s.',
$this->renderAuthor(),
$this->renderObject(),
- $this->renderOldValue(),
- $this->renderNewValue());
+ $this->renderLanguageValue($this->getOldValue()),
+ $this->renderLanguageValue($this->getNewValue()));
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 7, 9:09 PM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7350036
Default Alt Text
D16474.diff (1 KB)
Attached To
Mode
D16474: Fix the feed line items for autodetect paste languages
Attached
Detach File
Event Timeline
Log In to Comment