Add 'paste.query' conduit method and deprecate 'paste.info'
Summary: - Modernize the Paste Conduit API. - Deprecate 'paste.info'. - Make queries policy-aware. - Move methods into the application to support greater modularity. Test Plan: Made `paste.query`, `paste.info`, `paste.create` calls. Browsed Paste interfaces. Forked a paste. Reviewers: vrana, btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D3379
This commit is contained in:
@@ -43,6 +43,7 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController {
|
||||
$parent = id(new PhabricatorPasteQuery())
|
||||
->setViewer($user)
|
||||
->withIDs(array($parent_id))
|
||||
->needContent(true)
|
||||
->execute();
|
||||
$parent = head($parent);
|
||||
|
||||
@@ -105,11 +106,7 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController {
|
||||
if ($is_create && $parent) {
|
||||
$paste->setTitle('Fork of '.$parent->getFullName());
|
||||
$paste->setLanguage($parent->getLanguage());
|
||||
|
||||
$parent_file = id(new PhabricatorFile())->loadOneWhere(
|
||||
'phid = %s',
|
||||
$parent->getFilePHID());
|
||||
$text = $parent_file->loadFileData();
|
||||
$text = $parent->getContent();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user