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

tool_policy in moodle 4.1.2: Spreadsheet (CSV/XLSX/ODT) download in some cases not working

XMLWordPrintable

    • MOODLE_401_STABLE
    • MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-78023-401
    • Hide
      1. Log in as admin
      2. Navigate to Users > Privacy and policies > Policy settings in site administration
      3. Set Site policy handler to "Policies (tool_policy)" and save changes
      4. Navigate to Users > Privacy and policies > Manage policies in site administration
      5. Create new policy
        • Fill in required fields
        • Leave remaining fields as default
        • Set Policy status to "Active"
      6. Navigate to Users > Privacy and policies > User agreements in site administration
      7. Select "Policy: <YOURPOLICY>" from the Search keyword or select filter field
      8. Press Accept in the "Response" column for the admin user
      9. Press Give consent in subsequent dialogue
      10. From Download table data as select "Microsoft Excel (.xlsx)"
      11. Press Download
      12. Confirm the file is downloaded
      13. Open downloaded file
      14. Confirm the Date column contains human readable representation of the time you accepted the policy
      Show
      Log in as admin Navigate to Users > Privacy and policies > Policy settings in site administration Set Site policy handler to "Policies (tool_policy)" and save changes Navigate to Users > Privacy and policies > Manage policies in site administration Create new policy Fill in required fields Leave remaining fields as default Set Policy status to "Active" Navigate to Users > Privacy and policies > User agreements in site administration Select "Policy: <YOURPOLICY>" from the Search keyword or select filter field Press Accept in the "Response" column for the admin user Press Give consent in subsequent dialogue From Download table data as select "Microsoft Excel (.xlsx)" Press Download Confirm the file is downloaded Open downloaded file Confirm the Date column contains human readable representation of the time you accepted the policy

      When using the tool_policy plugin, user lists cannot be downloaded when using some type of policies.

      Steps to recreate:

      1. Site administration -> Privacy and policies/Policy Settings: sitepolicyhandler: choose "Policies (tool_policy)"
      2. Site administration -> Privacy and policies/Manage Policies: New policy
        Type: Other Policy
        User consent: All users
        Show policy before showing other policies : No
        Agreement optional: yes
      3. Agree to the policy with a few test accounts.
      4. As Admin: Site administration -> Privacy and policies/User agreements:
        As filter select the new policy and "Agreed"
        Click "Download"

      A new empty browser tab should open. File is not downloaded.

      tool_policy gives a string with unixtime digits to strftime() in date.php:719 but strftime() needs the string with a preceding "@".

      When when opening dev console in your browser, youn have to open the response to get the error message:

      Fehler: $timestamp argument is neither a valid UNIX timestamp, a valid date-time string or a DateTime object.

      Weitere Informationen über diesen Fehler
      Debug-Info:
      Error code: generalexceptionmessage
      Stack trace:

          line 725 of /lib/classes/date.php: InvalidArgumentException thrown
          line 2379 of /lib/moodlelib.php: call to core_date::strftime()
          line 576 of /admin/tool/policy/classes/acceptances_table.php: call to date_format_string()
          line 832 of /lib/tablelib.php: call to tool_policy\acceptances_table->col_timemodified()
          line 485 of /admin/tool/policy/classes/acceptances_table.php: call to flexible_table->format_row()
          line 2022 of /lib/tablelib.php: call to tool_policy\acceptances_table->format_row()
          line 2146 of /lib/tablelib.php: call to table_sql->build_table()
          line 240 of /admin/tool/policy/classes/acceptances_table.php: call to table_sql->out()
          line 49 of /admin/tool/policy/acceptances.php: call to tool_policy\acceptances_table->download()

        1. MDL-78023.png
          598 kB
          Ron Carl Alfon Yu

            pholden Paul Holden
            ipasanec Immanuel Pasanec
            Stevani Andolo Stevani Andolo
            Jake Dallimore Jake Dallimore
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 27 minutes
                1h 27m

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