1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 18:22:41 +01:00

Fix issue when editing a project with no secondary hash tags

Summary: Fixes T5186. If a project has no secondary tags, we issue a bogus query right now.

Test Plan: Edited a project with no secondary tags.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T5186

Differential Revision: https://secure.phabricator.com/D9300
This commit is contained in:
epriestley 2014-05-27 17:21:34 -07:00
parent 92ccadaa42
commit 70ec8052fd

View file

@ -305,8 +305,15 @@ final class PhabricatorProjectTransactionEditor
$slug_xaction = last($xactions); $slug_xaction = last($xactions);
$new = $slug_xaction->getNewValue(); $new = $slug_xaction->getNewValue();
if ($new) {
$slugs_used_already = id(new PhabricatorProjectSlug()) $slugs_used_already = id(new PhabricatorProjectSlug())
->loadAllWhere('slug IN (%Ls)', $new); ->loadAllWhere('slug IN (%Ls)', $new);
} else {
// The project doesn't have any extra slugs.
$slugs_used_already = array();
}
$slugs_used_already = mgroup($slugs_used_already, 'getProjectPHID'); $slugs_used_already = mgroup($slugs_used_already, 'getProjectPHID');
foreach ($slugs_used_already as $project_phid => $used_slugs) { foreach ($slugs_used_already as $project_phid => $used_slugs) {
$used_slug_strs = mpull($used_slugs, 'getSlug'); $used_slug_strs = mpull($used_slugs, 'getSlug');