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

list of courses to import from may be empty for some teachers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.1.1
    • Backup
    • centos 5.6 x86_64, apache 2.2.3, php 5.3.3, postgresql 8.4
    • PostgreSQL
    • MOODLE_21_STABLE
    • Hide

      Cf. attached patch for a possible (albeit rather brutal) workaround which discards the limit (0,250) from the call to get_recordset_sql.

      Show
      Cf. attached patch for a possible (albeit rather brutal) workaround which discards the limit (0,250) from the call to get_recordset_sql.
    • Hide

      User has capability moodle/restore:restorecourse on two courses A and B (for example because s/he is an editingteacher)
      User enters course A
      User tries to import content from course B (Settings -> Import)

      If the user is not capable of moodle/restore:restorecourse on one course within the first 250 items retrieved by the query, s/he is presented with an error dialog and no possiblity to search for a specific course

      Show
      User has capability moodle/restore:restorecourse on two courses A and B (for example because s/he is an editingteacher) User enters course A User tries to import content from course B (Settings -> Import) If the user is not capable of moodle/restore:restorecourse on one course within the first 250 items retrieved by the query, s/he is presented with an error dialog and no possiblity to search for a specific course

      Description of the problem
      For certain users at our site, the list of courses to import content from (settings -> import) is empty even though these users are editing teachers in a large number of courses. Furthermore, there is no way to search for specific courses once the error message is shown (contrary to the situation where a user has more than 10 potential courses to import from).

      Likely explaination
      According to our current understanding of moodle/backup/util/ui/restore_ui_components.php, the list of potential source courses is generated along the lines of

      • query (essentially) for all courses, limit the number of courses to (an arbitrary?) number of 250 results by means of $limitfrom/$limitnum parameters to the get_recordset_sql function @ line 167
      • iterate over all results in the recordset
      • determine whether the user has the proper capabilities (in our case this seems to be moodle/restore:restorecourse)
      • If courses where found in that way, display a list of said courses plus a search field to find additional courses outside the scope of this test
      • If no courses where found, display an error message (cf. attached screenshot)

      Our installation is rather large with approximately 600 (editing)teachers and currently about 11000 courses (most of them invisible, but still). Therefore, it is likely that a teacher ends up with an empty list after the first 250 results of the query have been processed. Since the generated dialog offers no means to narrow the search by hand, the user is essentially stuck at this point.

            stronk7 Eloy Lafuente (stronk7)
            martinschwinzerl Martin Schwinzerl (Inactive)
            Votes:
            9 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.