Skip to content

Commit

Permalink
OUWiki: Individual wiki edit other users content errors #8249
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-platts authored and sammarshallou committed Sep 16, 2013
1 parent d653eb4 commit 600ee5b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions annotate.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
$dataobject = new stdClass();
$dataobject->id = $key;
$dataobject->pageid = $pageversion->pageid;
$dataobject->userid = $userid;
$dataobject->userid = $USER->id;
$dataobject->timemodified = time();
$dataobject->content = $value;
$DB->update_record('ouwiki_annotations', $dataobject);
Expand All @@ -146,7 +146,7 @@
if ($value != '') {
$dataobject = new stdClass();
$dataobject->pageid = $pageversion->pageid;
$dataobject->userid = $userid;
$dataobject->userid = $USER->id;
$dataobject->timemodified = time();
$dataobject->content = $value;
$newannoid = $DB->insert_record('ouwiki_annotations', $dataobject);
Expand Down
1 change: 1 addition & 0 deletions edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@
$data->frompage = $frompage;
$data->newsection = $newsection;
$data->section = $section;
$data->user = $subwiki->userid;

// Prepare form file manager attachments
if ($useattachments) {
Expand Down
2 changes: 2 additions & 0 deletions edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ protected function definition() {
$mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'startversionid', null);
$mform->setType('startversionid', PARAM_INT);
$mform->addElement('hidden', 'user', null);
$mform->setType('user', PARAM_INT);
if (!$this->_customdata->startpage) {
$mform->addElement('hidden', 'page', '');
$mform->setType('page', PARAM_TEXT);
Expand Down
1 change: 1 addition & 0 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2166,6 +2166,7 @@ function ouwiki_display_create_page_form($subwiki, $cm, $pageversion) {
if ($pageversion->title !== '') {
$result .= '<input type="hidden" name="page" value="' . $pageversion->title . '" />';
}
$result .= '<input type="hidden" name="user" value="' . $subwiki->userid . '" />';
$result .= get_string('addnewsection', 'ouwiki') . ' ' .
'<input type="text" size="30" name="newsection" id="ouw_newsectionname" value="" />' .
'<input type="submit" id="ouw_add" name="ouw_subb" value="' .
Expand Down

0 comments on commit 600ee5b

Please sign in to comment.