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

Activities can only be added to startpage; adding new content to courses impossible





      Presumably after upgrade from Moodle 3.10 to 3.11.1 we encounter a problem in several moodle installations (but not all). The links in the activity chooser are always generated with GET parameter id=1, which refers obviously the startpage. By far i tracked it down to the generated javascript in view.php where the activitychooser constructor ist called with id=1 instead of the real courseid.

      M.util.js_pending('core_course/activitychooser'); require(['core_course/activitychooser'], function(amd) {amd.init("1", {"tabmode":"0"}); M.util.js_complete('core_course/activitychooser');});;

      Steps to reproduce:

      1. Login as admin.
      2. Go to "Site home" page.
      3. Add "Main menu" block to start page and enable visibility on every page.
      4. Visit any course page and try to add an activity/material

      Result: The activity edit page will come up as child of the start page (verify Breadcrumb nav or see request uri containing id=1. As you'll see, the links in the activitychooser will point to courseid=1 instead of the desired course

      Expected result: The activity will be added to the desired course.


      Actions taken:

      • cache purge by script as well as manual deletion
      • different course formats (is topic in affected moodle)
      • different themes  (is classic in affected moodle - tried boost alternatively)
      • Update Moodle 3.11.1 -> 3.11.2+
      • Web search for similar problems but no suggested solution helped (Guest user deleted, missing plugin source etc.)


      Manually edit the url that is shown in the activity chooser to contain the id of the desired course instead of id=1. Obviously not very user-friendly



        Issue Links



              Unassigned Unassigned
              misc Dr. Michael Schneider
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              4 Vote for this issue
              5 Start watching this issue