Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-45784

Lesson preview link visible for students in admin block

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.6.2, 2.8.1
    • 2.7.5, 2.8.3
    • Lesson
    • MOODLE_26_STABLE, MOODLE_28_STABLE
    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • MDL-45784-master
    • Hide
      1. As an admin create a lesson block
      2. Add some content to the lesson (e.g. pages)
      3. Log in as a student
      4. Go to the lesson and navigate around
      5. Ensure that the preview link does not appear in navigation
      Show
      As an admin create a lesson block Add some content to the lesson (e.g. pages) Log in as a student Go to the lesson and navigate around Ensure that the preview link does not appear in navigation

    Description

      Open a lesson activity as a student and you will be able to see a 'Preview' link under 'Lesson administration' in the Administration block.

      The link doesn't go anywhere.

      In /mod/lesson/lib.php, there's some missing code.

      This is what it currently is:

      $url = new moodle_url('/mod/lesson/view.php', array('id'=>$PAGE->cm->id));
      $lessonnode->add(get_string('preview', 'lesson'), $url);

      This is what it should be:

      if ($canedit)

      { $url = new moodle_url('/mod/lesson/view.php', array('id'=>$PAGE->cm->id)); $lessonnode->add(get_string('preview', 'lesson'), $url); }

      I've tested it and now students cannot see the 'preview' link in the admin block but teachers still can.

      Attachments

        Issue Links

          Activity

            People

              moodle.com Moodle HQ
              petejnz Pete Jones
              John Okely John Okely
              Dan Poltawski Dan Poltawski
              Dave Cooper Dave Cooper
              Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                2/Feb/15