@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make deleting a blog a little easier to recover from

Summary: We currently orphan posts when you delete a blog. Fixes some visibility and permission errors when that happens. Also... should allow you to archive posts.

Test Plan: Delete a blog, visit a post I made, still can see it.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9360

Differential Revision: https://secure.phabricator.com/D14457

+19 -6
+9 -3
src/applications/phame/controller/post/PhamePostViewController.php
··· 17 17 $blog = $post->getBlog(); 18 18 19 19 $crumbs = $this->buildApplicationCrumbs(); 20 - $crumbs->addTextCrumb( 21 - $blog->getName(), 22 - $this->getApplicationURI('blog/view/'.$blog->getID().'/')); 20 + if ($blog) { 21 + $crumbs->addTextCrumb( 22 + $blog->getName(), 23 + $this->getApplicationURI('blog/view/'.$blog->getID().'/')); 24 + } else { 25 + $crumbs->addTextCrumb( 26 + pht('[No Blog]'), 27 + null); 28 + } 23 29 $crumbs->addTextCrumb( 24 30 $post->getTitle(), 25 31 $this->getApplicationURI('post/view/'.$post->getID().'/'));
+8 -3
src/applications/phame/query/PhamePostSearchEngine.php
··· 81 81 82 82 foreach ($posts as $post) { 83 83 $id = $post->getID(); 84 - $blog = $viewer->renderHandle($post->getBlogPHID())->render(); 84 + $blog = $post->getBlog(); 85 + if ($blog) { 86 + $blog_name = $viewer->renderHandle($post->getBlogPHID())->render(); 87 + $blog_name = pht('Blog: %s', $blog_name); 88 + } else { 89 + $blog_name = pht('[No Blog]'); 90 + } 85 91 $item = id(new PHUIObjectItemView()) 86 92 ->setUser($viewer) 87 93 ->setObject($post) 88 94 ->setHeader($post->getTitle()) 89 95 ->setStatusIcon('fa-star') 90 96 ->setHref($this->getApplicationURI("/post/view/{$id}/")) 91 - ->addAttribute( 92 - pht('Blog: %s', $blog)); 97 + ->addAttribute($blog_name); 93 98 if ($post->isDraft()) { 94 99 $item->setStatusIcon('fa-star-o grey'); 95 100 $item->setDisabled(true);
+2
src/applications/phame/storage/PhamePost.php
··· 169 169 return $this->getBlog()->getViewPolicy(); 170 170 } else if ($this->getBlog()) { 171 171 return $this->getBlog()->getEditPolicy(); 172 + } else { 173 + return PhabricatorPolicies::POLICY_NOONE; 172 174 } 173 175 break; 174 176 case PhabricatorPolicyCapability::CAN_EDIT: