File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -181,7 +181,9 @@ public function createComment(string $comment): ContentComment
181
181
$ contentComment ->setContainerId ($ this ->getId ());
182
182
$ contentComment ->setContainerType ($ this ->getType ());
183
183
$ contentComment ->setContent ($ comment );
184
- $ contentComment ->setSpace ($ this ->getSpace ());
184
+ if ($ this ->getSpace ()) {
185
+ $ contentComment ->setSpace ($ this ->getSpace ());
186
+ }
185
187
return $ contentComment ;
186
188
}
187
189
@@ -193,10 +195,14 @@ public function createComment(string $comment): ContentComment
193
195
public function createSubpage (string $ title , string $ body ): ContentPage
194
196
{
195
197
$ contentPage = new ContentPage ();
196
- $ contentPage ->addAncestor ($ this ->id );
198
+ if ($ this ->id ) {
199
+ $ contentPage ->addAncestor ($ this ->id );
200
+ }
197
201
$ contentPage ->setContent ($ body );
198
202
$ contentPage ->setTitle ($ title );
199
- $ contentPage ->setSpace ($ this ->getSpace ());
203
+ if ($ this ->getSpace ()) {
204
+ $ contentPage ->setSpace ($ this ->getSpace ());
205
+ }
200
206
return $ contentPage ;
201
207
}
202
208
You can’t perform that action at this time.
0 commit comments