Skip to content

Commit

Permalink
Phriction - fix a corner case on renaming a project
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bobtrahan committed Jan 6, 2014
1 parent 66dd984 commit d63e530
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/applications/project/editor/PhabricatorProjectEditor.php
Expand Up @@ -250,8 +250,8 @@ private function applyTransactionEffect(
$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',
Expand Down

0 comments on commit d63e530

Please sign in to comment.