@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.

Fix handling of implicit comment transaction in paste creation

Summary:
Fixes T9850. The `getComment()` test should be a `hasComment()` test, in order to discard empty comments.

Also backport a couple of future fixes which can get you into trouble if you reconfigure forms in awkward ways.

Test Plan: Created a new paste without a comment.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9850

Differential Revision: https://secure.phabricator.com/D14571

+15 -3
+14 -2
src/applications/transactions/editfield/PhabricatorEditField.php
··· 320 320 } 321 321 322 322 protected function getValueExistsInSubmit(AphrontRequest $request, $key) { 323 - return $this->getHTTPParameterType()->getExists($request, $key); 323 + $type = $this->getHTTPParameterType(); 324 + 325 + if ($type) { 326 + return $type->getExists($request, $key); 327 + } 328 + 329 + return false; 324 330 } 325 331 326 332 protected function getValueFromSubmit(AphrontRequest $request, $key) { ··· 328 334 } 329 335 330 336 protected function getDefaultValue() { 331 - return $this->getHTTPParameterType()->getDefaultValue(); 337 + $type = $this->getHTTPParameterType(); 338 + 339 + if ($type) { 340 + return $type->getDefaultValue(); 341 + } 342 + 343 + return null; 332 344 } 333 345 334 346 final public function getHTTPParameterType() {
+1 -1
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 1888 1888 } 1889 1889 1890 1890 foreach ($no_effect as $key => $xaction) { 1891 - if ($xaction->getComment()) { 1891 + if ($xaction->hasComment()) { 1892 1892 $xaction->setTransactionType($type_comment); 1893 1893 $xaction->setOldValue(null); 1894 1894 $xaction->setNewValue(null);