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

Amin user can't view or edit other users profile: /lib/dml/moodle_database.php: dml_exception thrown

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Administration, Unknown
    • Labels:
      None
    • Environment:
      Moodle 2.0 preview 4+ (Build 20100918)
      Ubuntu 10.04, apache 2, php 5
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      I install a new moodle 2.0 site. It has an admin user and uses the default theme.

      I log in as the admin user and I manually create a new user (Settings/Site Admin/Usrs/Accounts/Add a new user)

      Then I go to see the list of all users (Settings/Site Admin/Usrs/Accounts/Browse list of users). The two users appear in the table. As admin, by clicking on the relevant part of the table, I can inspect and I can edit the adimin user account. As admin, if I try to view the other user;s profile or edit the other account get an error and these stack traces:

      (moodle/user/profile.php?id=3)

      ERROR: Mixed types of sql query parameters!!

      More information about this error
      Stack trace:

      • line 662 of /lib/dml/moodle_database.php: dml_exception thrown
      • line 685 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->fix_sql_params()
      • line 1540 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_recordset_sql()
      • line 1525 of /lib/dml/moodle_database.php: call to moodle_database->record_exists_sql()
      • line 1509 of /lib/dml/moodle_database.php: call to moodle_database->record_exists_select()
      • line 742 of /lib/accesslib.php: call to moodle_database->record_exists()
      • line 3242 of /lib/navigationlib.php: call to has_coursecontact_role()
      • line 3166 of /lib/navigationlib.php: call to settings_navigation->generate_user_settings()
      • line 2548 of /lib/navigationlib.php: call to settings_navigation->load_user_settings()
      • line 579 of /lib/pagelib.php: call to settings_navigation->initialise()
      • line 595 of /lib/pagelib.php: call to moodle_page->magic_get_settingsnav()
      • line 117 of /user/profile.php: call to moodle_page->__get()

      (/moodle/user/editadvanced.php?id=3&course=1)

      ERROR: Mixed types of sql query parameters!!
      Stack trace:

      • line 662 of /lib/dml/moodle_database.php: dml_exception thrown
      • line 685 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->fix_sql_params()
      • line 1540 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_recordset_sql()
      • line 1525 of /lib/dml/moodle_database.php: call to moodle_database->record_exists_sql()
      • line 1509 of /lib/dml/moodle_database.php: call to moodle_database->record_exists_select()
      • line 742 of /lib/accesslib.php: call to moodle_database->record_exists()
      • line 3242 of /lib/navigationlib.php: call to has_coursecontact_role()
      • line 3166 of /lib/navigationlib.php: call to settings_navigation->generate_user_settings()
      • line 2548 of /lib/navigationlib.php: call to settings_navigation->load_user_settings()
      • line 579 of /lib/pagelib.php: call to settings_navigation->initialise()
      • line 595 of /lib/pagelib.php: call to moodle_page->magic_get_settingsnav()
      • line 134 of /blocks/settings/block_settings.php: call to moodle_page->__get()
      • line 386 of /blocks/moodleblock.class.php: call to block_settings->get_content()
      • line 339 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
      • line 880 of /lib/blocklib.php: call to block_base->get_content_for_output()
      • line 932 of /lib/blocklib.php: call to block_manager->create_block_contents()
      • line 342 of /lib/blocklib.php: call to block_manager->ensure_content_created()
      • line 6 of /theme/base/layout/general.php: call to block_manager->region_has_content()
      • line 622 of /lib/outputrenderers.php: call to include()
      • line 580 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
      • line 245 of /user/editadvanced.php: call to core_renderer->header()

      So, the admin user can see and edit his own profile, but can't see or edit another user's profile. For what it is worth, if I give the other user admin priviledges he can see and edit his own profile, but can't see or edit the other user's profile. Clearing the php caches makes no difference.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              skodak Petr Skoda
              Reporter:
              neilleslie Neil Leslie
              Tester:
              Nobody
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10