diff --git a/mod/wiki/create.php b/mod/wiki/create.php
index <HASH>..<HASH> 100644
--- a/mod/wiki/create.php
+++ b/mod/wiki/create.php
@@ -73,6 +73,7 @@ $wikipage = new page_wiki_create($wiki, $subwiki, $cm);
 if (!empty($swid)) {
     $wikipage->set_gid($subwiki->groupid);
     $wikipage->set_uid($subwiki->userid);
+    $wikipage->set_swid($swid);
 } else {
     $wikipage->set_gid($gid);
     $wikipage->set_uid($uid);
wiki MDL-<I> fixed errors when editing is turned on when in wiki page creation.