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

Layout "courses" used in Badges and other locations, should use "incourse" layout.

    XMLWordPrintable

    Details

      Description

      In badges/view.php, badges/index.php, badges/edit.php and badges/newbadge.php the following line sets the layout:

          $PAGE->set_pagelayout('course');
      

      (Usually this is after checking it's not at the site level, where it uses "admin" instead).

      Since that's the layout for the main course index page it should presumably be:

          $PAGE->set_pagelayout('incourse');
      

      To use the layout for course modules. Otherwise anything that tries to target the main course page via "course" will hit the badge pages as well.

      While looking at this, I noticed there may be more pages with issues:

      git grep "pagelayout(.course.)"
       
      badges/edit.php:56:    $PAGE->set_pagelayout('course');
      badges/index.php:88:    $PAGE->set_pagelayout('course');
      badges/newbadge.php:50:    $PAGE->set_pagelayout('course');
      badges/view.php:74:    $PAGE->set_pagelayout('course');
      blocks/community/communitycourse.php:43:$PAGE->set_pagelayout('course');
      course/info.php:37:    $PAGE->set_pagelayout('course');
      course/publish/backup.php:57:$PAGE->set_pagelayout('course');
      course/publish/hubselector.php:37:$PAGE->set_pagelayout('course');
      course/publish/index.php:44:$PAGE->set_pagelayout('course');
      course/publish/metadata.php:48:$PAGE->set_pagelayout('course');
      course/resources.php:32:$PAGE->set_pagelayout('course');
      course/view.php:158:    $PAGE->set_pagelayout('course');
      enrol/index.php:49:$PAGE->set_pagelayout('course');
      files/coursefilesedit.php:46:$PAGE->set_pagelayout('course');
      files/index.php:71:$PAGE->set_pagelayout('course');
      message/index.php:129:    $PAGE->set_pagelayout('course');
      mod/glossary/showentry.php:42:$PAGE->set_pagelayout('course');
      notes/index.php:97:$PAGE->set_pagelayout('course');
      

      I think maybe only course/view.php should be using that layout.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ybozhko Yuliya Bozhko
              Reporter:
              bawjaws David Scotson
              Peer reviewer:
              Mark Nelson
              Integrator:
              Sam Hemelryk
              Tester:
              Marina Glancy
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Yuliya Bozhko, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Amy Groshek, David Scotson, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Bas Brands
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Nov/14