Updates Macro to use EditEngine. Also removes "URL" field for adding a Macro, which I think it's worth pursuing.
Details
Details
- Reviewers
epriestley - Commits
- rPc878bf50339c: Update Macro for EditEngine
- Create a Macro
- Forget to name it
- Try a PDF
- Use a Macro
- Edit a macro (not working)
Diff Detail
Diff Detail
- Repository
- rP Phabricator
- Branch
- macro-edit-engine (branched from master)
- Lint
Lint Passed - Unit
Tests Passed - Build Status
Buildable 16778 Build 22389: Run Core Tests Build 22388: 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. |
Comment Actions
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.
Comment Actions
- 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? |
Comment Actions
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).
src/applications/macro/xaction/PhabricatorMacroNameTransaction.php | ||
---|---|---|
70–72 | unusual indentation |