@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 "reply" link in Differential

Summary:
Fixes the issue caused by rPa0af5b66437719dba6136579c051982ab275e6a0. Prior to
that patch, isCommentInNewFile() returned $comment->getIsNewFile(). While this
was often the wrong value, it came from the database and was the integer 1 if
true.

After the patch, the function returns 'true' as a boolean, which is passed to JS
and then back to PHP, interpreted as an integer, and evaluates to 0.

To avoid this issue in general, provide an isBool() method on AphrontRequest
which interprets this correctly.

I will also revert the revert of rPa0af5b66437719dba6136579c051982ab275e6a0 when
I land this.

Test Plan:
Clicked "reply" on the right hand side of a diff, got a right-hand-side inline
comment.

Reviewed By: rm
Reviewers: tuomaspelkonen, jungejason, aran, rm
CC: simpkins, aran, epriestley, rm
Differential Revision: 250

+16 -2
+14
src/aphront/request/AphrontRequest.php
··· 68 68 } 69 69 } 70 70 71 + final public function getBool($name, $default = null) { 72 + if (isset($this->requestData[$name])) { 73 + if ($this->requestData[$name] === 'true') { 74 + return true; 75 + } else if ($this->requestData[$name] === 'false') { 76 + return false; 77 + } else { 78 + return (bool)$this->requestData[$name]; 79 + } 80 + } else { 81 + return $default; 82 + } 83 + } 84 + 71 85 final public function getStr($name, $default = null) { 72 86 if (isset($this->requestData[$name])) { 73 87 $str = (string)$this->requestData[$name];
+2 -2
src/applications/differential/controller/inlinecommentedit/DifferentialInlineCommentEditController.php
··· 28 28 $request = $this->getRequest(); 29 29 30 30 $changeset = $request->getInt('changeset'); 31 - $is_new = $request->getInt('is_new'); 32 - $on_right = $request->getInt('on_right'); 31 + $is_new = $request->getBool('is_new'); 32 + $on_right = $request->getBool('on_right'); 33 33 $number = $request->getInt('number'); 34 34 $length = $request->getInt('length'); 35 35 $text = $request->getStr('text');