Skip to content

Commit

Permalink
MDL-43109: mod/wiki - When editing pages populate the default value f…
Browse files Browse the repository at this point in the history
…or the tags input.
  • Loading branch information
Michael Dikih committed Dec 10, 2013
1 parent cf0e970 commit 2335308
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 0 additions & 2 deletions mod/wiki/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,8 @@ protected function definition() {
$mform->setType('contentformat', PARAM_ALPHANUMEXT);

if (!empty($CFG->usetags)) {
$tags = !isset($this->_customdata['tags'])?"":$this->_customdata['tags'];
$mform->addElement('header', 'tagshdr', get_string('tags', 'tag'));
$mform->addElement('tags', 'tags', get_string('tags'));
$mform->setDefault('tags', $tags);
$mform->setType('tags', PARAM_TEXT);
}

Expand Down
6 changes: 1 addition & 5 deletions mod/wiki/pagelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,10 +564,6 @@ protected function print_edit($content = null) {
$params['filearea'] = 'attachments';
}

if (!empty($CFG->usetags)) {
$params['tags'] = tag_get_tags_csv('wiki_pages', $this->page->id, TAG_RETURN_TEXT);
}

$form = new mod_wiki_edit_form($url, $params);

if ($formdata = $form->get_data()) {
Expand All @@ -576,7 +572,7 @@ protected function print_edit($content = null) {
}
} else {
if (!empty($CFG->usetags)) {
$data->tags = tag_get_tags_array('wiki', $this->page->id);
$data->tags = tag_get_tags_array('wiki_pages', $this->page->id);
}
}

Expand Down

0 comments on commit 2335308

Please sign in to comment.