Page MenuHomePhabricator

Update Macro for EditEngine
ClosedPublic

Authored by chad on May 3 2017, 5:23 PM.
Tags
None
Referenced Files
F13977909: D17821.diff
Fri, Oct 18, 8:35 PM
F13972382: D17821.id42850.diff
Thu, Oct 17, 6:40 PM
F13960973: D17821.id42854.diff
Tue, Oct 15, 2:22 AM
F13959633: D17821.id42849.diff
Mon, Oct 14, 8:06 PM
F13958593: D17821.id42849.diff
Mon, Oct 14, 3:35 PM
Unknown Object (File)
Oct 1 2024, 4:24 PM
Unknown Object (File)
Sep 22 2024, 7:09 AM
Unknown Object (File)
Sep 20 2024, 11:39 AM
Subscribers

Details

Summary

Updates Macro to use EditEngine. Also removes "URL" field for adding a Macro, which I think it's worth pursuing.

Test Plan
  • Create a Macro
  • Forget to name it
  • Try a PDF
  • Use a Macro
  • Edit a macro (not working)

Diff Detail

Repository
rP Phabricator
Branch
macro-edit-engine (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 16775
Build 22383: Run Core Tests
Build 22382: arc lint + arc unit

Event Timeline

src/applications/macro/controller/PhabricatorMacroEditController.php
9–10

Specifically, I don't know where to plop this and I get:

Testing for capability 'edit' on an object which does not have that capability!``` when I go to edit a macro.

PhabricatorFileImageMacro is ancient and doesn't expose a CAN_EDIT capability. To fix this:

  • Change getCapabilities() to return both VIEW and EDIT.
  • Change getPolicy() to return whatever PhabricatorMacroManageCapability::CAPABILITY is set to for EDIT.
  • Also, the EditEngine needs a getRequiredCreateCapabilility() or whatever which returns this capability -- I think Phame (maybe?) has a similar permission already ("Can Create Blogs") if that's too far off the mark to figure out.

can't wait for all the monies from macro improvements.

Nothing compared to that $weet Ponder ca$h.

  • works moreish
src/applications/macro/xaction/PhabricatorMacroNameTransaction.php
59–71

I keep getting a '' on old_value here, even when editing. Unsure where to get the value?

Like, the value itself has an extra double quote in it?

Oh, or $old_value is the empty string? Validation happens before old value population, just use $old_value = $this->generateOldValue($object).

epriestley added inline comments.
src/applications/macro/xaction/PhabricatorMacroNameTransaction.php
67–69

unusual indentation

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