Page MenuHomePhorge

Mark created Pholio mockups as new objects to fix empty Feed transaction entries
ClosedPublic

Authored by aklapper on Fri, Apr 19, 16:30.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 11, 17:25
Unknown Object (File)
Wed, May 8, 15:41
Unknown Object (File)
Sat, Apr 27, 08:03
Unknown Object (File)
Fri, Apr 26, 22:34
Unknown Object (File)
Fri, Apr 26, 02:19
Unknown Object (File)
Thu, Apr 25, 23:03
Unknown Object (File)
Thu, Apr 25, 23:03
Unknown Object (File)
Thu, Apr 25, 07:17
Tokens
"Love" token, awarded by valerio.bozzolan.

Details

Summary

When creating a Pholio mockup, setIsCreateTransaction(true) to avoid an empty Transaction field in the Feed and avoid strncmp() complaining about a null value being passed.

This is very similar to T15659 about Differential Diffs.

ERROR 8192: strncmp(): Passing null to parameter #1 ($string1) of type string is deprecated at [/var/www/html/phorge/phorge/src/applications/policy/query/PhabricatorPolicyQuery.php:314]

Closes T15679

Test Plan
  1. Create a new Pholio mockup via /pholio/create/
  2. Go to /feed/transactions/query/all/
  3. Compare entries in the Transaction column before (empty ones) and after (no empty ones) applying the patch.

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Screenshot before (M17) and after (M18) applying D25600:

Screenshot from 2024-04-19 18-20-53.png (834×1 px, 162 KB)

Probably we need some help to understand the semantic difference between these two:

  • PholioTransaction#setIsCreateTransaction(bool)
  • PholioMockEditor#setIsCreate(bool)

In any case, whenever it's the first one or the second (or both??) I'm quite sure we should set this only if $id is set.

Thanks again! This looks perfect in the current state of PholioMockEditor, since it's not an EditEngine and since this is not an appropriate moment to learn all the differences between an "Editor" and an "EditEngine" and/or it's not an appropriate moment to do that kind of migration here now (if ever needed).

sgtm

src/applications/pholio/controller/PholioMockEditController.php
111

✅ Calling setIsCreateTransaction(true) is useful thanks to PhabricatorApplicationTransactionEditor that looks for at least one transaction with that creation flag, and applies that creation flag to every other transaction:

https://we.phorge.it/source/phorge/browse/master/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php;29cbb0a6580fa2a94e8fae13fd4edef78efdeab0$1303-1317

This revision is now accepted and ready to land.Thu, May 9, 08:21

Unrelated but, thanks to your patch, we catched a possible micro-optimization. Here that unrelated change:

D25627: TransactionEditor: micro-optimize the "creation finder"