From 4acb7f63e85c0718cfb7ac4b51b2487ba245d9e4 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Wed, 30 Dec 2015 12:52:53 -0800 Subject: [PATCH] Drop domain key on PhameBlog Summary: Right now you can't create two blogs without a domain name, since it has a unique key on the column. Removing the key. Test Plan: Create two blogs with no domain name, works as expected. Create two blogs with `cat.dog` as domain name, get duplicate domain error. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T9360 Differential Revision: https://secure.phabricator.com/D14915 --- src/applications/phame/editor/PhameBlogEditor.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/applications/phame/editor/PhameBlogEditor.php b/src/applications/phame/editor/PhameBlogEditor.php index 3698293059..c73c2be0a4 100644 --- a/src/applications/phame/editor/PhameBlogEditor.php +++ b/src/applications/phame/editor/PhameBlogEditor.php @@ -47,9 +47,14 @@ final class PhameBlogEditor switch ($xaction->getTransactionType()) { case PhameBlogTransaction::TYPE_NAME: case PhameBlogTransaction::TYPE_DESCRIPTION: - case PhameBlogTransaction::TYPE_DOMAIN: case PhameBlogTransaction::TYPE_STATUS: return $xaction->getNewValue(); + case PhameBlogTransaction::TYPE_DOMAIN: + $domain = $xaction->getNewValue(); + if (!strlen($xaction->getNewValue())) { + return null; + } + return $domain; } }