@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Drag & Drop: fix JavaScript error related to JX.$(undefined)

Summary:
This change fixes the following recent JavaScript error:

Error: Empty ID passed to JX.$()!

The regression was introduced here:

90f9da643d1622bcfff3a8903159aeefd1b42520

Closes T15272

Test Plan: - with this change I was able to open Conpherence Persistent Chat and Drop a file

Reviewers: O1 Blessed Committers, Dylsss, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: Dylsss, speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15272

Differential Revision: https://we.phorge.it/D25134

+9 -5
+9 -5
webroot/rsrc/js/core/behavior-drag-and-drop-textarea.js
··· 27 27 drop.listen('didUpload', function(file) { 28 28 JX.TextAreaUtils.insertFileReference(target, file); 29 29 30 - var metadata = new JX.RemarkupMetadata(config.remarkupMetadataValue, 31 - config.remarkupMetadataID); 32 - var phids = metadata.getMetadata('attachedFilePHIDs', []); 33 - phids.push(file.getPHID()); 34 - metadata.setMetadata('attachedFilePHIDs', phids); 30 + if(config.remarkupMetadataID) { 31 + // Try to auto-attach files by default 32 + // https://we.phorge.it/T15106 33 + var metadata = new JX.RemarkupMetadata(config.remarkupMetadataValue, 34 + config.remarkupMetadataID); 35 + var phids = metadata.getMetadata('attachedFilePHIDs', []); 36 + phids.push(file.getPHID()); 37 + metadata.setMetadata('attachedFilePHIDs', phids); 38 + } 35 39 }); 36 40 37 41 drop.start();