Moodle
  1. Moodle
  2. MDL-44653

Include additional name fields in the user object

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.6.3
    • Component/s: Feedback
    • Labels:

      Description

      On Recent Activity page, I am getting this error message:
      You need to update your sql to include additional name fields in the user object.
      line 3570 of \lib\moodlelib.php: call to debugging()
      line 475 of \mod\feedback\lib.php: call to fullname()
      line 171 of \course\recent.php: call to feedback_get_recent_mod_activity()

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Andreas Grabs added a comment -

            Hi Joseph,
            thank you for reporting this. I have fixed it and hope it will be integrated soon.
            Best regards
            Andreas

            Show
            Andreas Grabs added a comment - Hi Joseph, thank you for reporting this. I have fixed it and hope it will be integrated soon. Best regards Andreas
            Hide
            Adrian Greeve added a comment -

            Hello Andreas,

            May I possibly suggest perhaps a solution like the following:

            $userfields = user_picture::fields('u');
            $sql = " SELECT fk . * , fc . * , $userfields
                                           FROM {feedback_completed} fc
                                           JOIN {feedback} fk ON fk.id = fc.feedback
                                           JOIN {user} u ON u.id = fc.userid ";
            

            Just so that if any further changes are made with addition fields, this section of code will not have to be updated again.

            Show
            Adrian Greeve added a comment - Hello Andreas, May I possibly suggest perhaps a solution like the following: $userfields = user_picture::fields('u'); $sql = " SELECT fk . * , fc . * , $userfields FROM {feedback_completed} fc JOIN {feedback} fk ON fk.id = fc.feedback JOIN {user} u ON u.id = fc.userid "; Just so that if any further changes are made with addition fields, this section of code will not have to be updated again.
            Hide
            CiBoT added a comment -

            Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!

            Show
            CiBoT added a comment - Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!
            Hide
            Andreas Grabs added a comment -

            Hi Adrian,
            thank you for this hint! I wasn't aware of that.
            I now have changed it in the way you mentioned.
            Best regards
            Andreas

            Show
            Andreas Grabs added a comment - Hi Adrian, thank you for this hint! I wasn't aware of that. I now have changed it in the way you mentioned. Best regards Andreas
            Hide
            Marina Glancy added a comment -

            Thanks Andreas but I have to reopen it.
            In this line
            https://github.com/grabs/moodle/blob/6da923f834407d3f3361f2e980c8d79bf2a2963c/mod/feedback/lib.php#L459

            you will use user id instead of feedback id.

            Show
            Marina Glancy added a comment - Thanks Andreas but I have to reopen it. In this line https://github.com/grabs/moodle/blob/6da923f834407d3f3361f2e980c8d79bf2a2963c/mod/feedback/lib.php#L459 you will use user id instead of feedback id.
            Hide
            Andreas Grabs added a comment -

            Hi Marina,
            thank you so much for keeping your eyes on my code .
            I have fixed it.
            Best regards
            Andreas

            Show
            Andreas Grabs added a comment - Hi Marina, thank you so much for keeping your eyes on my code . I have fixed it. Best regards Andreas
            Hide
            Marina Glancy added a comment -

            Thanks Andreas, integrated in 2.6 and master

            Show
            Marina Glancy added a comment - Thanks Andreas, integrated in 2.6 and master
            Hide
            Michael de Raadt added a comment -

            Test result: Passed.

            Tested in 2.6 and master.

            Show
            Michael de Raadt added a comment - Test result: Passed. Tested in 2.6 and master.
            Hide
            Marina Glancy added a comment -

            Thanks for your awesome code, it is now part of Moodle. Don't forget to submit another issue next week (and peer review two).

            Show
            Marina Glancy added a comment - Thanks for your awesome code, it is now part of Moodle. Don't forget to submit another issue next week (and peer review two).

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: