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

Avoid adding empty links to report actions action menu

    XMLWordPrintable

Details

    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • MDL-73983-master
    • Hide

      Test empty actions

      1) Log in as admin
      2) Create a new user called 'manager' and assign 'Manager' role
      3) Go to Site administration > Reports > Report Builder > Custom reports
      4) Create a new report using the 'Users' datasource
      5) Click on 'Audience' tab
      6) Click on 'Manually added users', select 'manager' user and press 'Save changes'
      5) Log in as 'manager'
      6) Go to Site administration > Reports > Report Builder > Custom reports
      7) Confirm that the Users report does not contain the cog icon with the report actions.
      8) As a manager create a new report using the 'Users' datasource and press the 'Close' button
      9) Confirm the cog icon is present in the new report row and contains the actions 'Edit report content', 'Edit report details', 'View report' and 'Delete report'

      Test custom action titles (copied from MDL-73836)

      1. Apply the MDL-73836.diff patch to your site
        1. Download the file
        2. On your moodle root folder apply the patch

          git apply /path/to/MDL-73836.diff
          

      2. Log in as admin
      3. Navigate to Reports > Report builder > Custom reports in site administration
      4. Create a new report named "My cool report"
      5. Close the editor, to get back to the list of reports
      6. Confirm the first action for your new report row has the title Perform action on: My cool report
      Show
      Test empty actions 1) Log in as admin 2) Create a new user called 'manager' and assign 'Manager' role 3) Go to Site administration > Reports > Report Builder > Custom reports 4) Create a new report using the 'Users' datasource 5) Click on 'Audience' tab 6) Click on 'Manually added users', select 'manager' user and press 'Save changes' 5) Log in as 'manager' 6) Go to Site administration > Reports > Report Builder > Custom reports 7) Confirm that the Users report does not contain the cog icon with the report actions. 8) As a manager create a new report using the 'Users' datasource and press the 'Close' button 9) Confirm the cog icon is present in the new report row and contains the actions 'Edit report content', 'Edit report details', 'View report' and 'Delete report' Test custom action titles (copied from MDL-73836 ) Apply the MDL-73836.diff patch to your site Download the file On your moodle root folder apply the patch git apply /path/to/MDL-73836.diff Log in as admin Navigate to Reports > Report builder > Custom reports in site administration Create a new report named "My cool report" Close the editor, to get back to the list of reports Confirm the first action for your new report row has the title Perform action on: My cool report

    Description

      If the report action has a callback method to check a permission, and this method returns false, the action link is still added to the action menu but with null value and its also noticeable from the UI.

      Attachments

        1. empty_action_links.jpg
          empty_action_links.jpg
          9 kB
        2. MDL-73836.diff
          0.9 kB
        3. Step No. 7_SCreenshot.PNG
          Step No. 7_SCreenshot.PNG
          48 kB
        4. Step No. 9_Screenshot.PNG
          Step No. 9_Screenshot.PNG
          51 kB
        5. Test custom action titles_Screenshot.PNG
          Test custom action titles_Screenshot.PNG
          61 kB

        Issue Links

          Activity

            People

              davidmatamoros David Matamoros
              davidmatamoros David Matamoros
              Paul Holden Paul Holden
              Jun Pataleta Jun Pataleta
              Gladys Basiana Gladys Basiana
              Carlos Castillo, David Matamoros, Mikel Martín Corrales, Paul Holden
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                19/Apr/22

                Time Tracking

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