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

Invalid parameter error when a calendar block has limited permission

XMLWordPrintable

    • MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_37_STABLE, MOODLE_38_STABLE
    • Hide
      1. Login as admin
      2. Navigate to Site home
      3. Select Turn editing on from the Actions menu
      4. Press Add a block
      5. Press on the Calendar block
      6. In the new Calendar block, select Permissions from the Actions menu
      7. For the capability "View block", press Delete authenticated user role
      8. Confirm that you really want to remove "Authenticated user" from the list of allowed roles for capability "View block" in context "Block: Calendar"
      9. Navigate back to Site home and confirm the Calendar block is still present and you can scroll through the months via AJAX
      10. Logout
      11. Login as a normal user
      12. Navigate to Site home
      13. Confirm you don't get an "Invalid parameter value detected" exception on the page
      14. Confirm the Calendar block isn't present (because you don't have the capability to view it)
      15. Confirm any other blocks on the page are still present
      Show
      Login as admin Navigate to Site home Select Turn editing on from the Actions menu Press Add a block Press on the Calendar block In the new Calendar block, select Permissions from the Actions menu For the capability "View block", press Delete authenticated user role Confirm that you really want to remove "Authenticated user" from the list of allowed roles for capability "View block" in context "Block: Calendar" Navigate back to Site home and confirm the Calendar block is still present and you can scroll through the months via AJAX Logout Login as a normal user Navigate to Site home Confirm you don't get an "Invalid parameter value detected" exception on the page Confirm the Calendar block isn't present (because you don't have the capability to view it) Confirm any other blocks on the page are still present

      Hi,

      I put a calendar block only on the default dashboard or on the home page for all site.
      I limit the view block permission for only one system role, auther than "Authentticated user". For example, only "manager" can see the block.

      When one page with de block is dipalyed and if the user has not the role with the permission to view the calendar block (not "manager" in my above example), the folowing error occurs :

        Invalid parameter value detected
      File: /lib/externallib.php
      Line: 332
      Stack trace:
      Missing required key in single structure: year
      Error code: invalidparameter

      • line 332 of /lib/externallib.php: invalid_parameter_exception thrown
      • line 223 of /lib/externallib.php: call to external_api::validate_parameters()
      • line 79 of /lib/ajax/service.php: call to external_api::call_external_function()
         
        I had see the bug for the first time on Moodle 3.8+(Build: 20191205) and I do a test on the lasted 3.8.1+(Build: 20200228) with the same issue.
        It's a similar issue than [MDL-67140|http://example.com,] normaly resolved.
         
        The steps to reproduce the issue are :

      1) On the home page, put a calendar block (for all pages in my use case).
      2) Limit the block view permission for only one system role, but not "Authentticated user" ("manager" , for example).
      3) Connect you whith an user who does not have the role with the permission (not "manager" in my above example).
      4) Go to a page where the calendar block is potentialy dispalyed.

      Best regards,
      Jacques
       

            pholden Paul Holden
            jibecc Jacques Barzic
            Peter Dias Peter Dias
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 50 minutes
                2h 50m

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