Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 6947c57a0648db1e03fcc0a2d0bc0fe428dac595 1 parent 85c4758
Rajesh Taneja rajeshtaneja authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 mod/wiki/pagelib.php
9 mod/wiki/pagelib.php
View
@@ -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.