@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 PHP 8.1 Diffusion history errors

Summary:
Fix multiple PHP 8.1 errors when viewing Diffusion history.

Fixes T15573

Test Plan: View a diffusion history page. Eg https://my.php81.phorge.site/source/myrepo/history/master/

Reviewers: O1 Blessed Committers, speck

Reviewed By: O1 Blessed Committers, speck

Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15573

Differential Revision: https://we.phorge.it/D25366

sten 1802ebd2 fa687b4b

+7 -5
+4 -5
src/applications/diffusion/controller/DiffusionHistoryController.php
··· 50 50 // ancestors appropriately, but this would currrently be prohibitively 51 51 // expensive in the general case. 52 52 53 - $show_graph = !strlen($drequest->getPath()); 53 + $show_graph = !phutil_nonempty_string($drequest->getPath()); 54 54 if ($show_graph) { 55 55 $history_list 56 56 ->setParents($history_results['parents']) ··· 98 98 $viewer = $this->getViewer(); 99 99 $repository = $drequest->getRepository(); 100 100 101 - $no_path = !strlen($drequest->getPath()); 102 - if ($no_path) { 101 + if (phutil_nonempty_string($drequest->getPath())) { 102 + $header_text = $this->renderPathLinks($drequest, $mode = 'history'); 103 + } else { 103 104 $header_text = pht('History'); 104 - } else { 105 - $header_text = $this->renderPathLinks($drequest, $mode = 'history'); 106 105 } 107 106 108 107 $header = id(new PHUIHeaderView())
+3
src/applications/diffusion/query/pathid/DiffusionPathIDQuery.php
··· 48 48 */ 49 49 public static function normalizePath($path) { 50 50 51 + // Ensure we have a string, not a null. 52 + $path = coalesce($path, ''); 53 + 51 54 // Normalize to single slashes, e.g. "///" => "/". 52 55 $path = preg_replace('@[/]{2,}@', '/', $path); 53 56