1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 07:12:41 +01:00

Phriction - fix a corner case on renaming a project

Summary: if you rename a project in such a way that the old slug and the new slug are the same, there are errors when the phriction document is updated. detect this case and don't bother updating the document since there is no change. Fixes Github issue 474.

Test Plan: made a project "testTest". Viewed the wiki page. Created the wiki page. Renamed the project "TestTest". Before patch, this error'd, post patch it works!

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D7888
This commit is contained in:
Bob Trahan 2014-01-06 11:19:02 -08:00
parent 66dd984db5
commit d63e530608

View file

@ -250,8 +250,8 @@ final class PhabricatorProjectEditor extends PhabricatorEditor {
$old_slug = $project->getFullPhrictionSlug();
$project->setName($xaction->getNewValue());
$project->setPhrictionSlug($xaction->getNewValue());
if ($xaction->getOldValue()) {
$changed_slug = $old_slug != $project->getFullPhrictionSlug();
if ($xaction->getOldValue() && $changed_slug) {
$old_document = id(new PhrictionDocument())
->loadOneWhere(
'slug = %s',