Why are the tags for T379335 indented as such?
Description
Details
| Title | Reference | Author | Source Branch | Dest Branch | |
|---|---|---|---|---|---|
| Task list view: Do not render tag for Deadline tasks without due date | repos/phabricator/extensions!42 | aklapper | T379376emptyDueDate | wmf/stable |
Related Objects
- Mentioned In
- T335395: Remove "Deadline" task subtype
T380915: Phabricator weekly changes email: Include open Deadline type tasks without Due Date - Mentioned Here
- T335367: Deadline herald rule is broken
rPHEXbc14cc06e117: Make the date field in deadline tasks accessible to herald
T310188: Due Date stamp rendering requires "deadline" task subtype; does not show for other task subtypes though Due Date field is filled
T335395: Remove "Deadline" task subtype
rPHABae334e4589a0: Add custom task deadline display on workboard cards.
T379335: Feature request: automatically change the article's language variant to your primary language from the deep link
Event Timeline
Why are the tags for T379335 indented as such?
Because there's an empty task subtype entry for that task's subtype deadline. https://phabricator.wikimedia.org/source/phabricator/browse/wmf%252Fstable/src/applications/maniphest/view/ManiphestTaskListView.php$103-108 in upstream is not supposed to render this when there is no hasTagView, in theory.
Custom downstream https://phabricator.wikimedia.org/rPHABae334e4589a0413c1eb8a9e8d993e553bfeff478 might be related / to blame for this behavior.
See also T335395: Remove "Deadline" task subtype and T310188: Due Date stamp rendering requires "deadline" task subtype; does not show for other task subtypes though Due Date field is filled.
Code triggering this behavior is custom hasTagView() in https://gitlab.wikimedia.org/repos/phabricator/extensions/-/blob/wmf/stable/src/customfields/DeadlineEditEngineSubtype.php not checking that the storage value can be empty, basically:
diff --git a/src/customfields/DeadlineEditEngineSubtype.php b/src/customfields/DeadlineEditEngineSubtype.php index 0d48826..839ece1 100644 --- a/src/customfields/DeadlineEditEngineSubtype.php +++ b/src/customfields/DeadlineEditEngineSubtype.php @@ -8,6 +8,11 @@ class DeadlineEditEngineSubtype extends PhabricatorEditEngineSubtype { } public function hasTagView() { + $deadline = $this->getDeadline(PhabricatorUser::getOmnipotentUser()); + // Tasks can have Deadline type but an empty deadline value - T379376 + if ($deadline && !$deadline->getValueForStorage()) { + return false; + } return true; }
Ideally I'd say that tasks shouldn't be of subtype "Deadline" when no Due Date is set. But our entire custom Deadline implementation is...interesting.
aklapper opened https://gitlab.wikimedia.org/repos/phabricator/extensions/-/merge_requests/42
Task list view: Do not render tag for Deadline tasks without due date
Digging more into code history related to T379376, it looks like rPHEXbc14cc06e1176db0a89deab7ffcf58b68ad36060 hid the issue in T379376 in the past, as we had H295 and H296 avoiding this situation by automatically changing task subtype. However I disabled these Herald rules as the internal implementation of custom fields had somehow changed (I'm not aware of details though) and is now broken only showing "Unknown Field" in the Herald settings (and rPHEXbc14cc06e1176db0a89deab7ffcf58b68ad36060 not doing anymore what it was supposed to do?), which made me file https://we.phorge.it/T15885 and https://we.phorge.it/T15887 in upstream to potentially make Phorge code more robust.
Naively trying to re-set up these two Herald rules, the "Custom Fields" section in the Herald rule "Conditions" dropdown does not list a Deadline/Due Date field nowadays but there are none of our three date type Custom Fields offered in Herald (and none of type users either) as https://secure.phabricator.com/T655#131721 implies it's not supported (which makes me wonder if we changed the Deadline custom field to a date type in maniphest.custom-field-definitions at some point?).
aklapper merged https://gitlab.wikimedia.org/repos/phabricator/extensions/-/merge_requests/42
Task list view: Do not render tag for Deadline tasks without due date

