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

Do not create a second default workboard column on existing disabled board

Summary:
A project workboard may have existed before but got disabled. When trying to access this workboard, do not trigger `buildInitializeContent()` which will create yet another default workboard column (and duplicates the existing column on the disabled workboard) but call `buildEnableContent()` which will display the "Workboard Disabled" panel instead allowing to re-enable the workboard.

Also fix some wrong indentation in a section below.

Closes T16475

Test Plan:
1. Create a new project.
2. Select "Workboard" from the left sidebar.
3. Select default "Columns: New Empty Board" for that project, and click the "Create Workboard" button.
4. In the right upper corner, select {nav icon=cog}, click {nav icon=cog,name=Manage Workboard}, and select {nav icon=ban,name=Disable Workboard}
5. End up on resulting http://phorge.localhost/project/board/1/, or go explicitly to that URI by selecting "Workboard" in the project navigation panel on the left
6. Before this patch, it shows the "Create Workboard" panel, allowing you to again select "Columns: New Empty Board", click the "Create Workboard" button, and see now two default columns both named "Backlog (Default)" on the (re-enabled) workboard
7. After this patch, it shows the "Disabled Workboard" panel with a button to re-enable the workboard

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16475

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

+18 -11
+18 -11
src/applications/project/controller/PhabricatorProjectBoardViewController.php
··· 41 41 if ($project->getHasWorkboard()) { 42 42 $layout_engine = $state->getLayoutEngine(); 43 43 $columns = $layout_engine->getColumns($board_phid); 44 + } else { 45 + // Avoid setting up from scratch if board existed but got disabled 46 + $columns = id(new PhabricatorProjectColumnQuery()) 47 + ->setViewer($viewer) 48 + ->withProjectPHIDs(array($project->getPHID())) 49 + ->withIsProxyColumn(false) 50 + ->execute(); 44 51 } 45 52 46 53 if (!$columns || !$project->getHasWorkboard()) { ··· 941 948 ->setProjectPHID($project->getPHID()) 942 949 ->save(); 943 950 944 - $xactions = array(); 945 - $xactions[] = id(new PhabricatorProjectTransaction()) 946 - ->setTransactionType( 947 - PhabricatorProjectWorkboardTransaction::TRANSACTIONTYPE) 948 - ->setNewValue(1); 951 + $xactions = array(); 952 + $xactions[] = id(new PhabricatorProjectTransaction()) 953 + ->setTransactionType( 954 + PhabricatorProjectWorkboardTransaction::TRANSACTIONTYPE) 955 + ->setNewValue(1); 949 956 950 - id(new PhabricatorProjectTransactionEditor()) 951 - ->setActor($viewer) 952 - ->setContentSourceFromRequest($request) 953 - ->setContinueOnNoEffect(true) 954 - ->setContinueOnMissingFields(true) 955 - ->applyTransactions($project, $xactions); 957 + id(new PhabricatorProjectTransactionEditor()) 958 + ->setActor($viewer) 959 + ->setContentSourceFromRequest($request) 960 + ->setContinueOnNoEffect(true) 961 + ->setContinueOnMissingFields(true) 962 + ->applyTransactions($project, $xactions); 956 963 957 964 return id(new AphrontRedirectResponse()) 958 965 ->setURI($board_uri);