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

Badges entity in report builder can not be left joined

XMLWordPrintable

    • MOODLE_401_STABLE
    • MOODLE_401_STABLE
    • MDL-76073-master
    • Hide
      • Put this file https://gist.github.com/marinaglancy/4d73664dc907a56db33cd95e0811b82a
        in badges/classes/reportbuilder/datasource/userbadges.php
      • Login as admin, purge caches
      • Create a badge (Site administration>Badges>Manage badges) and assign it to at least one user. Make sure you have users who do not have badges too
      • Go to Reports (in user picture menu)
      • Create a new report from the "User badges" datasource
      • Add all fields from the "Badge" entity - make sure the badges info is displayed for users who have badges and nothing is displayed for users without badges
      Show
      Put this file https://gist.github.com/marinaglancy/4d73664dc907a56db33cd95e0811b82a in badges/classes/reportbuilder/datasource/userbadges.php Login as admin, purge caches Create a badge (Site administration>Badges>Manage badges) and assign it to at least one user. Make sure you have users who do not have badges too Go to Reports (in user picture menu) Create a new report from the "User badges" datasource Add all fields from the "Badge" entity - make sure the badges info is displayed for users who have badges and nothing is displayed for users without badges

      This came up while working on MDL-75358

      Several display callbacks in the 'badge' entity of report builder assume that badge is always present and do not have nullable arguments.

      To reproduce it you can use the datasource "user left join badge_issues left join badges"

      • Put this file https://gist.github.com/marinaglancy/4d73664dc907a56db33cd95e0811b82a
        in badges/classes/reportbuilder/datasource/userbadges.php
      • Login as admin, purge caches
      • Create a badge (Site administration>Badges>Manage badges) and assign it to at least one user. Make sure you have users who do not have badges too
      • Go to Reports (in user picture menu)
      • Create a new report from the "User badges" datasource
      • Add all fields from the "Badge" entity - make sure the badges info is displayed for users who have badges and nothing is displayed for users without badges

      Prior to the patch you will not be able to add all columns, there are a lot of exceptions coming from callbacks

            marina Marina Glancy
            marina Marina Glancy
            David Carrillo David Carrillo
            Jake Dallimore Jake Dallimore
            Angelia Dela Cruz Angelia Dela Cruz
            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 - 3 hours, 40 minutes
                3h 40m

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