Page MenuHomePhabricator

Modernize PonderQuestion with EditEngine
ClosedPublic

Authored by chad on May 1 2017, 8:35 PM.
Tags
None
Referenced Files
F14036386: D17812.diff
Sun, Nov 10, 10:03 AM
F14030080: D17812.diff
Fri, Nov 8, 11:49 PM
F14029872: D17812.diff
Fri, Nov 8, 10:06 PM
F14027954: D17812.id42830.diff
Fri, Nov 8, 11:06 AM
F14011062: D17812.id42830.diff
Thu, Oct 31, 4:10 PM
F14010030: D17812.id42830.diff
Thu, Oct 31, 3:18 AM
F14009478: D17812.id42830.diff
Wed, Oct 30, 6:41 PM
F13993871: D17812.id42830.diff
Wed, Oct 23, 1:58 AM
Subscribers

Details

Summary

Just a small touch up to move this to edit engine.

Test Plan
  • Create a question
  • Edit a question
  • Close question
  • Test NUX state

Diff Detail

Repository
rP Phabricator
Branch
ponder-answer-feed (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 16762
Build 22363: Run Core Tests
Build 22362: arc lint + arc unit

Event Timeline

I can't get this to work, obviously every conversion comes with little bugs. Specifically I get "bad setter call getEditPolicy" which isn't set because we use a moderator policy for Ponder. It's automatically being set on the EditEngine and I'm not sure how to decline setting it.

I think the issue is that PonderQuestionEditor->getTransactionTypes() currently looks like this:

public function getTransactionTypes() {
  $types = parent::getTransactionTypes();

  $types[] = PhabricatorTransactions::TYPE_COMMENT;
  $types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
  $types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
  $types[] = PhabricatorTransactions::TYPE_SPACE;

  return $types;
}

I believe:

  • COMMENT and SPACE get determined automatically by using instanceof to identify interfaces the object implements, and can be removed.
  • EDIT is wrong (you can not edit the edit policy of a question) and should be removed.
  • VIEW is correct.

Removing EDIT should fix the getEditPolicy() issue, I think.

src/applications/ponder/editor/PonderQuestionEditor.php
75

Comment also still needed, not modernized.

I considered trying to vet this thoroughly locally but I imagine I'll just hit 200 pre-existing bugs and we're better off not knowing they exist.

This revision is now accepted and ready to land.May 3 2017, 5:31 PM
This revision was automatically updated to reflect the committed changes.