Skip to content

Commit f81e821

Browse files
committed
Mark manually created Diffs as new objects to fix empty Feed transaction entries
Summary: When creating a Differential diff manually via `/differential/diff/create/` in the web browser instead of using Arcanist, `setIsCreateTransaction(true)` for the transaction type `DifferentialDiffTransaction::TYPE_DIFF_CREATE` to avoid an empty `Transaction` field in the Feed and avoid `strncmp()` complaining about a null value being passed. For gory details, see the comments in T15659. ``` ERROR 8192: strncmp(): Passing null to parameter freebsd#1 ($string1) of type string is deprecated at [/var/www/html/phorge/phorge/src/applications/policy/query/PhabricatorPolicyQuery.php:314] ``` Closes T15659 Test Plan: 1. Create a valid diff via `/differential/diff/create/` 2. Go to `/feed/transactions/query/advanced/` and set `Object Types` to `Differential Diff` and click `Search` 3. See two entries in the `Transaction` column for the just created diff: One says "created this diff", the other one says "created this object with visibility" and is not an empty line anymore which triggered an exception. Reviewers: O1 Blessed Committers, aklapper Reviewed By: O1 Blessed Committers, aklapper Subscribers: avivey, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15659 Differential Revision: https://we.phorge.it/D25517
1 parent 01b5bf9 commit f81e821

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: src/applications/differential/conduit/DifferentialCreateRawDiffConduitAPIMethod.php

+2
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,14 @@ protected function execute(ConduitAPIRequest $request) {
7171
$xactions = array(
7272
id(new DifferentialDiffTransaction())
7373
->setTransactionType(DifferentialDiffTransaction::TYPE_DIFF_CREATE)
74+
->setIsCreateTransaction(true)
7475
->setNewValue($diff_data_dict),
7576
);
7677

7778
if ($request->getValue('viewPolicy')) {
7879
$xactions[] = id(new DifferentialDiffTransaction())
7980
->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY)
81+
->setIsCreateTransaction(true)
8082
->setNewValue($request->getValue('viewPolicy'));
8183
}
8284

0 commit comments

Comments
 (0)