mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Fix issue where phame "View Live" functionality works by using POST not GET
Summary: Currently you can't refresh the live blog or a blog post after clicking "View Live" due to POST action. I have removed the setRenderAsForm call on the "View Live" actions. I am unsure if this has any unintended consequences but I have tested and not found any. Test Plan: Click the "View Live" action within a blog post or blog, and observe that the request occurs via GET not POST Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D6314
This commit is contained in:
parent
5db26c1b3a
commit
4770437bb3
2 changed files with 5 additions and 2 deletions
|
@ -156,6 +156,8 @@ final class PhameBlogViewController extends PhameController {
|
||||||
$blog,
|
$blog,
|
||||||
PhabricatorPolicyCapability::CAN_JOIN);
|
PhabricatorPolicyCapability::CAN_JOIN);
|
||||||
|
|
||||||
|
$must_use_form = $blog->getDomain();
|
||||||
|
|
||||||
$actions->addAction(
|
$actions->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setIcon('new')
|
->setIcon('new')
|
||||||
|
@ -169,7 +171,7 @@ final class PhameBlogViewController extends PhameController {
|
||||||
->setUser($user)
|
->setUser($user)
|
||||||
->setIcon('world')
|
->setIcon('world')
|
||||||
->setHref($this->getApplicationURI('live/'.$blog->getID().'/'))
|
->setHref($this->getApplicationURI('live/'.$blog->getID().'/'))
|
||||||
->setRenderAsForm(true)
|
->setRenderAsForm($must_use_form)
|
||||||
->setName(pht('View Live')));
|
->setName(pht('View Live')));
|
||||||
|
|
||||||
$actions->addAction(
|
$actions->addAction(
|
||||||
|
|
|
@ -137,6 +137,7 @@ final class PhamePostViewController extends PhameController {
|
||||||
|
|
||||||
$blog = $post->getBlog();
|
$blog = $post->getBlog();
|
||||||
$can_view_live = $blog && !$post->isDraft();
|
$can_view_live = $blog && !$post->isDraft();
|
||||||
|
$must_use_form = $blog && $blog->getDomain();
|
||||||
|
|
||||||
if ($can_view_live) {
|
if ($can_view_live) {
|
||||||
$live_uri = 'live/'.$blog->getID().'/post/'.$post->getPhameTitle();
|
$live_uri = 'live/'.$blog->getID().'/post/'.$post->getPhameTitle();
|
||||||
|
@ -151,7 +152,7 @@ final class PhamePostViewController extends PhameController {
|
||||||
->setIcon('world')
|
->setIcon('world')
|
||||||
->setHref($live_uri)
|
->setHref($live_uri)
|
||||||
->setName(pht('View Live'))
|
->setName(pht('View Live'))
|
||||||
->setRenderAsForm(true)
|
->setRenderAsForm($must_use_form)
|
||||||
->setDisabled(!$can_view_live)
|
->setDisabled(!$can_view_live)
|
||||||
->setWorkflow(!$can_view_live));
|
->setWorkflow(!$can_view_live));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue