@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

Fix a JS error when adding a project card directly to a subproject from a workboard

Summary:
Fixes T12152. When creating a subproject task directly from a parent project, we can get column information back about the subproject column, which isn't visible. Just ignore this rather than trying to draw a card into a column which does not exist.

This flow (see test plan) is a little unintuitive since the card never appears on the workboard, but this class of things is probably roughly somewhere in T4900.

Test Plan:
- Create a parent project A.
- Create subproject B.
- On the workboard for A, select "Create Task..." from the dropdown.
- Add tag "B" in the dialog that pops up.
- Save the task.

Note that this flow creates a task tagged only with "B", since "A" and "B" are mutually exclusive tags.

Before patch: UI freezes (JX.Mask is never removed), JS error in console.
After patch: workflow completes. Note that card is (correctly) not visible: it's in an invisible subproject column.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12152

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

+19 -12
+11 -11
resources/celerity/map.php
··· 439 439 'rsrc/js/application/phortune/phortune-credit-card-form.js' => '2290aeef', 440 440 'rsrc/js/application/policy/behavior-policy-control.js' => 'd0c516d5', 441 441 'rsrc/js/application/policy/behavior-policy-rule-editor.js' => '5e9f347c', 442 - 'rsrc/js/application/projects/WorkboardBoard.js' => 'fe7cb52a', 442 + 'rsrc/js/application/projects/WorkboardBoard.js' => '8935deef', 443 443 'rsrc/js/application/projects/WorkboardCard.js' => 'c587b80f', 444 444 'rsrc/js/application/projects/WorkboardColumn.js' => '21df4ff5', 445 445 'rsrc/js/application/projects/WorkboardController.js' => '55baf5ed', ··· 765 765 'javelin-view-renderer' => '6c2b09a2', 766 766 'javelin-view-visitor' => 'efe49472', 767 767 'javelin-websocket' => 'e292eaf4', 768 - 'javelin-workboard-board' => 'fe7cb52a', 768 + 'javelin-workboard-board' => '8935deef', 769 769 'javelin-workboard-card' => 'c587b80f', 770 770 'javelin-workboard-column' => '21df4ff5', 771 771 'javelin-workboard-controller' => '55baf5ed', ··· 1573 1573 'javelin-stratcom', 1574 1574 'javelin-dom', 1575 1575 ), 1576 + '8935deef' => array( 1577 + 'javelin-install', 1578 + 'javelin-dom', 1579 + 'javelin-util', 1580 + 'javelin-stratcom', 1581 + 'javelin-workflow', 1582 + 'phabricator-draggable-list', 1583 + 'javelin-workboard-column', 1584 + ), 1576 1585 '8a41885b' => array( 1577 1586 'javelin-install', 1578 1587 'javelin-dom', ··· 2248 2257 'javelin-dom', 2249 2258 'javelin-view-visitor', 2250 2259 'javelin-util', 2251 - ), 2252 - 'fe7cb52a' => array( 2253 - 'javelin-install', 2254 - 'javelin-dom', 2255 - 'javelin-util', 2256 - 'javelin-stratcom', 2257 - 'javelin-workflow', 2258 - 'phabricator-draggable-list', 2259 - 'javelin-workboard-column', 2260 2260 ), 2261 2261 'fea0eb47' => array( 2262 2262 'javelin-install',
+8 -1
webroot/rsrc/js/application/projects/WorkboardBoard.js
··· 204 204 205 205 if (!this._templates[phid]) { 206 206 for (var add_phid in response.columnMaps) { 207 - this.getColumn(add_phid).newCard(phid); 207 + var target_column = this.getColumn(add_phid); 208 + 209 + if (!target_column) { 210 + // If the column isn't visible, don't try to add a card to it. 211 + continue; 212 + } 213 + 214 + target_column.newCard(phid); 208 215 } 209 216 } 210 217