If my issue is the same as yours, it is caused when the 'Force format' checkbox is checked. I believe I have isolated the portion of code. Before creating a page, there is a check to see if the subwiki exists or not. It uses the variable $this-wid, as the wiki id. However, under certain conditions, (force format checked), this variable does not exists.
This is my hack patch (Although I am not familiar enough with moodle's API to guarentee that I've done this right...)
--- orig/mod/wiki/pagelib.php 2012-05-12 11:26:46.000000000 +1000
+++ mtest/mod/wiki/pagelib.php 2012-05-30 07:42:26.000000000 +1000
@@ -946,7 +946,7 @@
} else {
$groupid = '0';
}
- if (!$this->subwiki = wiki_get_subwiki_by_group($this->wid, $groupid)) {
+ if (!$this->subwiki = wiki_get_subwiki_by_group((empty($this->wid)?$PAGE->activityrecord->id:$this->wid), $groupid)) {
$swid = wiki_add_subwiki($PAGE->activityrecord->id, $groupid, $this->uid);
$this->subwiki = wiki_get_subwiki($swid);
}
I'll look at creating a ticket, to see if one of the devs can confirm that my patch is the right way to go about it, or not...