1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +01:00

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
This commit is contained in:
epriestley 2011-09-12 11:11:45 -07:00
parent bd778b4c8e
commit 0366936d4c

View file

@ -53,6 +53,7 @@ final class PhrictionDocumentEditor {
$content = new PhrictionContent(); $content = new PhrictionContent();
$content->setSlug($slug); $content->setSlug($slug);
$content->setTitle($default_title); $content->setTitle($default_title);
$content->setContent('');
} }
$obj = new PhrictionDocumentEditor(); $obj = new PhrictionDocumentEditor();