Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INT-9199: Fix coursepage javascript #24

Open
wants to merge 1 commit into
base: MOODLE_29_STABLE
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion renderers/snap_shared.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,13 @@ public static function page_requires_js() {
$module
);

$pagehascoursecontent = ($PAGE->pagetype === 'site-index' || $PAGE->url->get_path() === '/course/view.php');

// Are we viewing /course/view.php - note, this is different from just checking the page type.
// We only ever want to load course.js when on site page or view.php - no point in loading it when on
// course settings page, etc.
$courseviewpage = stripos($PAGE->url->out_as_local_url(), '/course/view.php') === 0;
$pagehascoursecontent = ($PAGE->pagetype === 'site-index' || $courseviewpage);

// Does the page have editable course content?
if ($pagehascoursecontent && $PAGE->user_allowed_editing()) {
$module = array(
Expand Down