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

Column 'mdl_user.firstnamephonetic' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.1
    • Fix Version/s: 2.6.3
    • Component/s: Tags
    • Labels:
    • Database:
      Microsoft SQL, Oracle
    • Testing Instructions:
      Hide

      Note Please test this on all databases.

      1. Log in as the administrator.
      2. Create a blog entry and add some fields to the tag section towards the bottom.
      3. Go to [Site administration ► Users ► Permissions ► User policies] and set "Full name format" to something like "firstname middlename lastname" and save.
      4. Go to [Site administration ► Appearance ► Manage tags] and ensure that no error messages are displayed.
      Show
      Note Please test this on all databases. Log in as the administrator. Create a blog entry and add some fields to the tag section towards the bottom. Go to [Site administration ► Users ► Permissions ► User policies] and set "Full name format" to something like "firstname middlename lastname" and save. Go to [Site administration ► Appearance ► Manage tags] and ensure that no error messages are displayed.
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL-43719-master

      Description

      When clicking the Manage Tags link under Appearance in the Site Administration Menu.

      Error reading from database 
      Debug: Column 'mdl_user.firstnamephonetic' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
       SELECT TOP 30 tg.id, tg.name, tg.rawname, tg.tagtype, tg.flag, tg.timemodified,
                     u.id AS owner, u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.firstname,u.lastname,
                     COUNT(ti.id) AS count
                FROM mdl_tag tg
           LEFT JOIN mdl_tag_instance ti ON ti.tagid = tg.id
           LEFT JOIN mdl_user u ON u.id = tg.userid
                     
            GROUP BY tg.id, tg.name, tg.rawname, tg.tagtype, tg.flag, tg.timemodified,
                     u.id, u.firstname, u.lastname
               ORDER BY flag DESC
      [array (
      )]
      Error code: dmlreadexception
      * line 441 of \lib\dml\moodle_database.php: dml_read_exception thrown
      * line 242 of \lib\dml\mssql_native_moodle_database.php: call to moodle_database->query_end()
      * line 716 of \lib\dml\mssql_native_moodle_database.php: call to mssql_native_moodle_database->query_end()
      * line 750 of \lib\dml\mssql_native_moodle_database.php: call to mssql_native_moodle_database->get_recordset_sql()
      * line 250 of \tag\manage.php: call to mssql_native_moodle_database->get_records_sql()
      

      Referring to MDL-43283 and wondering if fix would be adding $allusernames to the end of the Group By clause in moodle\tag\manage.php:

      Line 234 u.id, u.firstname, u.lastname, $allusernames
      Line 235 $sort;

        Attachments

          Activity

            People

            Assignee:
            abgreeve Adrian Greeve
            Reporter:
            nlidden Nicholas Lidden
            Peer reviewer:
            Ankit Agarwal
            Integrator:
            Dan Poltawski
            Tester:
            Rajesh Taneja
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              12/May/14