Skip to content

Commit

Permalink
MDL-49985 core_course: revert commit belonging to MDL-18309
Browse files Browse the repository at this point in the history
This reverts commit 6601690.

This commit was adding the 'returnurl' param unnecessarily to the
course links in the navigation block, causing a lot of long URLs
to be created.
  • Loading branch information
mdjnelson committed May 5, 2015
1 parent 24a2bab commit b3cb726
Show file tree
Hide file tree
Showing 17 changed files with 12 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,7 @@ BRANCH.prototype = {
id : this.get('key'),
type : this.get('type'),
sesskey : M.cfg.sesskey,
instance : this.get('tree').get('instance'),
returnurl : location.href
instance : this.get('tree').get('instance')
};

var ajaxfile = '/lib/ajax/getnavbranch.php';
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,7 @@ BRANCH.prototype = {
id : this.get('key'),
type : this.get('type'),
sesskey : M.cfg.sesskey,
instance : this.get('tree').get('instance'),
returnurl : location.href
instance : this.get('tree').get('instance')
};

var ajaxfile = '/lib/ajax/getnavbranch.php';
Expand Down
3 changes: 1 addition & 2 deletions blocks/navigation/yui/src/navigation/js/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,7 @@ BRANCH.prototype = {
id : this.get('key'),
type : this.get('type'),
sesskey : M.cfg.sesskey,
instance : this.get('tree').get('instance'),
returnurl : location.href
instance : this.get('tree').get('instance')
};

var ajaxfile = '/lib/ajax/getnavbranch.php';
Expand Down
3 changes: 0 additions & 3 deletions course/category.ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,11 @@

require_once(dirname(__dir__) . '/config.php');

$returnurl = optional_param('returnurl', 0, PARAM_LOCALURL);

if ($CFG->forcelogin) {
require_login();
}

$PAGE->set_context(context_system::instance());
$courserenderer = $PAGE->get_renderer('core', 'course');
$courserenderer->returnurl = $returnurl;

echo json_encode($courserenderer->coursecat_ajax());
1 change: 0 additions & 1 deletion course/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@

$PAGE->set_pagelayout('coursecategory');
$courserenderer = $PAGE->get_renderer('core', 'course');
$courserenderer->returnurl = $PAGE->url;

if ($CFG->forcelogin) {
require_login();
Expand Down
6 changes: 1 addition & 5 deletions course/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ class core_course_renderer extends plugin_renderer_base {
*/
protected $strings;

/** @var moodle_url|null stores page where to return to from the enrolment page */
public $returnurl;

/**
* Override the constructor so that we can initialise the string cache
*
Expand Down Expand Up @@ -1210,8 +1207,7 @@ protected function coursecat_coursebox(coursecat_helper $chelper, $course, $addi

// course name
$coursename = $chelper->get_course_formatted_name($course);
$coursenamelink = html_writer::link(new moodle_url('/course/view.php',
array('id' => $course->id, 'returnurl' => $this->returnurl)),
$coursenamelink = html_writer::link(new moodle_url('/course/view.php', array('id' => $course->id)),
$coursename, array('class' => $course->visible ? '' : 'dimmed'));
$content .= html_writer::tag($nametag, $coursenamelink, array('class' => 'coursename'));
// If we display course in collapsed form but the course has summary or course contacts, display the link to the info page.
Expand Down
4 changes: 0 additions & 4 deletions course/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
$switchrole = optional_param('switchrole',-1, PARAM_INT); // Deprecated, use course/switchrole.php instead.
$modchooser = optional_param('modchooser', -1, PARAM_BOOL);
$return = optional_param('return', 0, PARAM_LOCALURL);
$returnurl = optional_param('returnurl', 0, PARAM_LOCALURL);

$params = array();
if (!empty($name)) {
Expand All @@ -43,9 +42,6 @@
if ($section) {
$urlparams['section'] = $section;
}
if ($returnurl) {
$urlparams['returnurl'] = $returnurl;
}

$PAGE->set_url('/course/view.php', $urlparams); // Defined here to avoid notices on errors etc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ NS._toggle_category_expansion = function(e) {
categoryid: categoryid,
depth: depth,
showcourses: categorynode.getData('showcourses'),
type: TYPE_CATEGORY,
returnurl: location.href
type: TYPE_CATEGORY
}
});
};
Expand Down
Loading

0 comments on commit b3cb726

Please sign in to comment.