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

Impossible to configure block added to /course/completion.php

    XMLWordPrintable

    Details

      Description

      Discovered while working on issue MDL-38682
      Page /course/completion.php (pagetype = "course-completion") does not have a string defined in lang/en/pagetypes.php ('page-course-completion'). In such cases it gets impossible to configure block added to this page so it stays only on this page.

      To replicate:

      1. Enable course completion globally and for particular course
      2. Inside course navigate to Course administration->Completion tracking
      3. Add any block (i.e. html)
      4. Make sure block does not appear on other pages in course (for example course view page)
      5. Return to the completion page, click block configuration (in editing mode)
      6. Change title of the block and save it
      7. Now magically the block is displayed on ANY course page

      This happens because the dropdown "Where block appears"->"Display on page types" does not have the option for the particular page (it is only added if the string is defined) and when form is displayed the default value becomes the first in the list, which is "any course page". Especially now when this section is collapsed user would not even notice.

      We can add all missing pagetype strings but it will happen again when somebody adds new page to /course/.

      admin_page_type_list() solves it by adding:
      $pagetype => get_string('page-admin-current', 'pagetype')

      course_page_type_list() misses something like that

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                marina Marina Glancy
                Participants:
                Component watchers:
                Adrian Greeve, Mihail Geshoski, Peter Dias, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: