Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDl-33607 wiki-2: check subwiki before fetching it from db

  • Loading branch information...
commit 840818cce43a26afde8b1d79a0c78d6691603477 1 parent 4776262
@rajeshtaneja rajeshtaneja authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 mod/wiki/pagelib.php
View
9 mod/wiki/pagelib.php
@@ -946,9 +946,12 @@ function create_page($pagetitle) {
} else {
$groupid = '0';
}
- if (!$this->subwiki = wiki_get_subwiki_by_group($this->wid, $groupid)) {
- $swid = wiki_add_subwiki($PAGE->activityrecord->id, $groupid, $this->uid);
- $this->subwiki = wiki_get_subwiki($swid);
+ if (empty($this->subwiki)) {
+ // If subwiki is not set then try find one and set else create one.
+ if (!$this->subwiki = wiki_get_subwiki_by_group($this->wid, $groupid)) {
+ $swid = wiki_add_subwiki($PAGE->activityrecord->id, $groupid, $this->uid);
+ $this->subwiki = wiki_get_subwiki($swid);
+ }
}
if ($data) {
$this->set_title($data->pagetitle);
Please sign in to comment.
Something went wrong with that request. Please try again.