Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14840472
D14457.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D14457.diff
View Options
diff --git a/src/applications/phame/controller/post/PhamePostViewController.php b/src/applications/phame/controller/post/PhamePostViewController.php
--- a/src/applications/phame/controller/post/PhamePostViewController.php
+++ b/src/applications/phame/controller/post/PhamePostViewController.php
@@ -17,9 +17,15 @@
$blog = $post->getBlog();
$crumbs = $this->buildApplicationCrumbs();
- $crumbs->addTextCrumb(
- $blog->getName(),
- $this->getApplicationURI('blog/view/'.$blog->getID().'/'));
+ if ($blog) {
+ $crumbs->addTextCrumb(
+ $blog->getName(),
+ $this->getApplicationURI('blog/view/'.$blog->getID().'/'));
+ } else {
+ $crumbs->addTextCrumb(
+ pht('[No Blog]'),
+ null);
+ }
$crumbs->addTextCrumb(
$post->getTitle(),
$this->getApplicationURI('post/view/'.$post->getID().'/'));
diff --git a/src/applications/phame/query/PhamePostSearchEngine.php b/src/applications/phame/query/PhamePostSearchEngine.php
--- a/src/applications/phame/query/PhamePostSearchEngine.php
+++ b/src/applications/phame/query/PhamePostSearchEngine.php
@@ -81,15 +81,20 @@
foreach ($posts as $post) {
$id = $post->getID();
- $blog = $viewer->renderHandle($post->getBlogPHID())->render();
+ $blog = $post->getBlog();
+ if ($blog) {
+ $blog_name = $viewer->renderHandle($post->getBlogPHID())->render();
+ $blog_name = pht('Blog: %s', $blog_name);
+ } else {
+ $blog_name = pht('[No Blog]');
+ }
$item = id(new PHUIObjectItemView())
->setUser($viewer)
->setObject($post)
->setHeader($post->getTitle())
->setStatusIcon('fa-star')
->setHref($this->getApplicationURI("/post/view/{$id}/"))
- ->addAttribute(
- pht('Blog: %s', $blog));
+ ->addAttribute($blog_name);
if ($post->isDraft()) {
$item->setStatusIcon('fa-star-o grey');
$item->setDisabled(true);
diff --git a/src/applications/phame/storage/PhamePost.php b/src/applications/phame/storage/PhamePost.php
--- a/src/applications/phame/storage/PhamePost.php
+++ b/src/applications/phame/storage/PhamePost.php
@@ -169,6 +169,8 @@
return $this->getBlog()->getViewPolicy();
} else if ($this->getBlog()) {
return $this->getBlog()->getEditPolicy();
+ } else {
+ return PhabricatorPolicies::POLICY_NOONE;
}
break;
case PhabricatorPolicyCapability::CAN_EDIT:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 2, 6:33 AM (12 h, 51 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7083876
Default Alt Text
D14457.diff (2 KB)
Attached To
Mode
D14457: Make deleting a blog a little easier to recover from
Attached
Detach File
Event Timeline
Log In to Comment