mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-21 22:32:41 +01:00
Fix project page 404 after rename and removing new name from alias slugs
Summary: When renaming a project to a slug already listed under Additional hashtags and explicitly also removing that to-become slug, accessing the project via the URL `/tag/projectname/` returned a 404 until someone added the current project name explicitly under "Additional hashtags" again. In that case, do not remove the alternative hashtag to avoid the 404. Closes T15636 Test Plan: See steps in https://we.phorge.it/T15636 Reviewers: O1 Blessed Committers, speck Reviewed By: O1 Blessed Committers, speck Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15636 Differential Revision: https://we.phorge.it/D25453
This commit is contained in:
parent
222a6fea0a
commit
887e344c19
1 changed files with 6 additions and 0 deletions
|
@ -295,6 +295,12 @@ final class PhabricatorProjectTransactionEditor
|
|||
}
|
||||
|
||||
public function removeSlugs(PhabricatorProject $project, array $slugs) {
|
||||
// Do not allow removing the project's primary slug which the edit form
|
||||
// may allow through a series of renames/moves. See T15636
|
||||
if (($key = array_search($project->getPrimarySlug(), $slugs)) !== false) {
|
||||
unset($slugs[$key]);
|
||||
}
|
||||
|
||||
if (!$slugs) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue