From 0366936d4c647df2fced809a2110fab25bb25ed7 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 12 Sep 2011 11:11:45 -0700 Subject: [PATCH] Set default content to "" (empty string), not null, in PhrictionDocumentEditor Summary: phriction.edit allows you to omit the content string, meaning "don't edit content". If you're also creating the page, we currently break in a terrible, horrible, no-good, very-bad way because 'content' can't be null. Default to empty string instead so phriction.edit creates an empty page instead of a broken mess. Test Plan: Called phriction.edit on a new page with no content. Reviewers: skrul, jungejason, nh, tuomaspelkonen, aran Reviewed By: skrul CC: aran, skrul Differential Revision: 920 --- .../phriction/editor/document/PhrictionDocumentEditor.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/applications/phriction/editor/document/PhrictionDocumentEditor.php b/src/applications/phriction/editor/document/PhrictionDocumentEditor.php index c760d405ec..2db32e05b3 100644 --- a/src/applications/phriction/editor/document/PhrictionDocumentEditor.php +++ b/src/applications/phriction/editor/document/PhrictionDocumentEditor.php @@ -53,6 +53,7 @@ final class PhrictionDocumentEditor { $content = new PhrictionContent(); $content->setSlug($slug); $content->setTitle($default_title); + $content->setContent(''); } $obj = new PhrictionDocumentEditor();