1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-09 16:32:39 +01:00

Comments: avoid confusing warning about "core:file"

Summary:
If you are reading this commit message, it probably happened to you this situation:

1. Somebody published a comment that shows the file F123
2. You Submit another comment that shows F123 again

After you click "Submit", a wild warning may appear:

> Post as Comment
> ----
> The action you are taking has no effect:
> Transaction (of type "core:file") has no effect.
> Do you want to post your comment anyway?
> [Undo] [Continue]

In this case you probably contact your favorite Phorge administrator to translate that stuff.
This is an example unofficial translation:

> Post as Comment
> ----
> You mentioned a file. Phorge loves files. Phorge attach files. But somebody else already
> mentioned that file, successfully. So, since Phorge attach Files, Phorge will result in
> doing nothing special, since the file is already perfectly attached by Phorge.
> Phorge will just post your comment.
> Would you like me to just STFU and post your comment?
> [OMG I'm scared] [Post comment and STFU]

After this change you don't see anymore that warning. So it's even rarer in your Pokedex.

Closes T15293

Test Plan:
- Create a comment showing F123 (an existing file)
- Create another comment showing F123
- No wild warnings

Reviewers: O1 Blessed Committers, 20after4

Reviewed By: O1 Blessed Committers, 20after4

Subscribers: 20after4, speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15293

Differential Revision: https://we.phorge.it/D25544
This commit is contained in:
Valerio Bozzolan 2024-02-28 16:24:25 +01:00
parent 7cee42ca26
commit 6df26b98c1

View file

@ -2320,6 +2320,7 @@ abstract class PhabricatorApplicationTransactionEditor
}
$xaction = $object->getApplicationTransactionTemplate()
->setIgnoreOnNoEffect(true)
->setTransactionType(PhabricatorTransactions::TYPE_FILE)
->setMetadataValue('attach.implicit', true)
->setNewValue($new_map);