Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15338565
D10411.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D10411.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -8,7 +8,7 @@
return array(
'names' => array(
'core.pkg.css' => '974635bb',
- 'core.pkg.js' => '4e529147',
+ 'core.pkg.js' => 'cebacb31',
'darkconsole.pkg.js' => 'df001cab',
'differential.pkg.css' => '36884139',
'differential.pkg.js' => '73337d1d',
@@ -438,7 +438,7 @@
'rsrc/js/application/uiexample/notification-example.js' => '7a9677fc',
'rsrc/js/core/Busy.js' => '6453c869',
'rsrc/js/core/DragAndDropFileUpload.js' => '8c49f386',
- 'rsrc/js/core/DraggableList.js' => '98d13594',
+ 'rsrc/js/core/DraggableList.js' => '2a6a1041',
'rsrc/js/core/FileUpload.js' => 'a4ae61bf',
'rsrc/js/core/Hovercard.js' => '7e8468ae',
'rsrc/js/core/KeyboardShortcut.js' => '1ae869f2',
@@ -713,7 +713,7 @@
'phabricator-crumbs-view-css' => 'a49339de',
'phabricator-dashboard-css' => 'a2bfdcbf',
'phabricator-drag-and-drop-file-upload' => '8c49f386',
- 'phabricator-draggable-list' => '98d13594',
+ 'phabricator-draggable-list' => '2a6a1041',
'phabricator-fatal-config-template-css' => '25d446d6',
'phabricator-feed-css' => '7bfc6f12',
'phabricator-file-upload' => 'a4ae61bf',
@@ -987,6 +987,14 @@
'javelin-install',
'javelin-util',
),
+ '2a6a1041' => array(
+ 'javelin-install',
+ 'javelin-dom',
+ 'javelin-stratcom',
+ 'javelin-util',
+ 'javelin-vector',
+ 'javelin-magical-init',
+ ),
'2b228192' => array(
'javelin-behavior',
'javelin-dom',
@@ -1437,14 +1445,6 @@
'javelin-dom',
'javelin-reactor-dom',
),
- '98d13594' => array(
- 'javelin-install',
- 'javelin-dom',
- 'javelin-stratcom',
- 'javelin-util',
- 'javelin-vector',
- 'javelin-magical-init',
- ),
'9c2623f4' => array(
'javelin-behavior',
'javelin-stratcom',
diff --git a/resources/sql/autopatches/20140904.macroattach.php b/resources/sql/autopatches/20140904.macroattach.php
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20140904.macroattach.php
@@ -0,0 +1,26 @@
+<?php
+
+$table = new PhabricatorFileImageMacro();
+foreach (new LiskMigrationIterator($table) as $macro) {
+ $name = $macro->getName();
+
+ echo "Linking macro '{$name}'...\n";
+
+ $editor = new PhabricatorEdgeEditor();
+
+ $phids[] = $macro->getFilePHID();
+ $phids[] = $macro->getAudioPHID();
+ $phids = array_filter($phids);
+
+ if ($phids) {
+ foreach ($phids as $phid) {
+ $editor->addEdge(
+ $macro->getPHID(),
+ PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE,
+ $phid);
+ }
+ $editor->save();
+ }
+}
+
+echo "Done.\n";
diff --git a/src/applications/macro/controller/PhabricatorMacroMemeController.php b/src/applications/macro/controller/PhabricatorMacroMemeController.php
--- a/src/applications/macro/controller/PhabricatorMacroMemeController.php
+++ b/src/applications/macro/controller/PhabricatorMacroMemeController.php
@@ -3,6 +3,10 @@
final class PhabricatorMacroMemeController
extends PhabricatorMacroController {
+ public function shouldAllowPublic() {
+ return true;
+ }
+
public function processRequest() {
$request = $this->getRequest();
$macro_name = $request->getStr('macro');
diff --git a/src/applications/macro/editor/PhabricatorMacroEditor.php b/src/applications/macro/editor/PhabricatorMacroEditor.php
--- a/src/applications/macro/editor/PhabricatorMacroEditor.php
+++ b/src/applications/macro/editor/PhabricatorMacroEditor.php
@@ -82,19 +82,39 @@
protected function applyCustomExternalTransaction(
PhabricatorLiskDAO $object,
PhabricatorApplicationTransaction $xaction) {
- return;
- }
-
- protected function extractFilePHIDsFromCustomTransaction(
- PhabricatorLiskDAO $object,
- PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
case PhabricatorMacroTransactionType::TYPE_FILE:
- return array($xaction->getNewValue());
+ case PhabricatorMacroTransactionType::TYPE_AUDIO:
+ // When changing a macro's image or audio, attach the underlying files
+ // to the macro (and detach the old files).
+ $old = $xaction->getOldValue();
+ $new = $xaction->getNewValue();
+ $all = array();
+ if ($old) {
+ $all[] = $old;
+ }
+ if ($new) {
+ $all[] = $new;
+ }
+
+ $files = id(new PhabricatorFileQuery())
+ ->setViewer($this->requireActor())
+ ->withPHIDs($all)
+ ->execute();
+ $files = mpull($files, null, 'getPHID');
+
+ $old_file = idx($files, $old);
+ if ($old_file) {
+ $old_file->detachFromObject($object->getPHID());
+ }
+
+ $new_file = idx($files, $new);
+ if ($new_file) {
+ $new_file->attachToObject($this->requireActor(), $object->getPHID());
+ }
+ break;
}
-
- return array();
}
protected function mergeTransactions(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 10, 11:29 AM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7433744
Default Alt Text
D10411.diff (4 KB)
Attached To
Mode
D10411: Fix old image macros and memes for logged out users
Attached
Detach File
Event Timeline
Log In to Comment