Page MenuHomePhabricator

Update Macro for EditEngine
ClosedPublic

Authored by chad on May 3 2017, 5:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Sep 4, 7:10 PM
Unknown Object (File)
Wed, Aug 28, 11:49 PM
Unknown Object (File)
Wed, Aug 28, 5:26 PM
Unknown Object (File)
Wed, Aug 28, 3:22 AM
Unknown Object (File)
Aug 19 2024, 1:48 AM
Unknown Object (File)
Aug 17 2024, 10:08 AM
Unknown Object (File)
Aug 12 2024, 7:19 PM
Unknown Object (File)
Aug 9 2024, 4:37 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 16779
Build 22391: Run Core Tests
Build 22390: 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
62–74

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
70–72

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.