@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.

Fix handling of Phriction conduit edits

Summary: See https://discourse.phabricator-community.org/t/conduit-method-phriction-edit-requires-title-while-the-docs-say-its-optional/2176. Make code consistent with documentation by not requiring either `content` or `title`.

Test Plan: Hit the method via the UI and no longer got an error on missing `content` or `title` fields.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

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

+13 -6
+13 -6
src/applications/phriction/conduit/PhrictionEditConduitAPIMethod.php
··· 41 41 } 42 42 43 43 $xactions = array(); 44 - $xactions[] = id(new PhrictionTransaction()) 45 - ->setTransactionType(PhrictionDocumentTitleTransaction::TRANSACTIONTYPE) 46 - ->setNewValue($request->getValue('title')); 47 - $xactions[] = id(new PhrictionTransaction()) 48 - ->setTransactionType(PhrictionDocumentContentTransaction::TRANSACTIONTYPE) 49 - ->setNewValue($request->getValue('content')); 44 + if ($request->getValue('title')) { 45 + $xactions[] = id(new PhrictionTransaction()) 46 + ->setTransactionType( 47 + PhrictionDocumentTitleTransaction::TRANSACTIONTYPE) 48 + ->setNewValue($request->getValue('title')); 49 + } 50 + 51 + if ($request->getValue('content')) { 52 + $xactions[] = id(new PhrictionTransaction()) 53 + ->setTransactionType( 54 + PhrictionDocumentContentTransaction::TRANSACTIONTYPE) 55 + ->setNewValue($request->getValue('content')); 56 + } 50 57 51 58 $editor = id(new PhrictionTransactionEditor()) 52 59 ->setActor($request->getUser())