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

Message screen does not use the course language

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.6
    • 2.4.5
    • Course, Messages
    • MOODLE_24_STABLE
    • MOODLE_26_STABLE
    • wip-MDL-41369-master
    • Hide
      1. Create several courses with several participants, some with capability 'moodle/site:viewparticipants' and 'moodle/course:viewparticipants', some without
      2. Change the language of one course and theme of another course
      3. Login as one user, try sending messages to another user inside the course and from users list. Note that there are many ways to send message to the user - from participants/users list click on user name, there will be link to send message under avatar and in navigation block. Also one can navigate to recent conversations and courses participants from dropdown on message page.
      4. Inside the messaging try to select different items from dropdown
      5. During the test make sure that navigation path is correct (both navbar and navigation block), messaging inside the course are displayed with course environment (language, theme, blocks)
      Show
      Create several courses with several participants, some with capability 'moodle/site:viewparticipants' and 'moodle/course:viewparticipants', some without Change the language of one course and theme of another course Login as one user, try sending messages to another user inside the course and from users list. Note that there are many ways to send message to the user - from participants/users list click on user name, there will be link to send message under avatar and in navigation block. Also one can navigate to recent conversations and courses participants from dropdown on message page. Inside the messaging try to select different items from dropdown During the test make sure that navigation path is correct (both navbar and navigation block), messaging inside the course are displayed with course environment (language, theme, blocks)
    • BACKEND Sprint 4

      If you view a user profile from your course and send him a private message the course language would be another than the language of the course.

      Steps

      • Create a course and choose english for Language.
      • Choose Portuguese (or another) for the default language of the site.
      • List the participants of the course.
      • Choose one, click to see his profile.
      • Send him a message from the Send message link in user/view.php
      • The message form would have the Portuguese language (it was expected to be English language).

      Why this is bad ?
      If you invite an English teacher to run a moodle course in Brazil for example, he will see some screens in Portuguese.

      Fix:
      In the file user/view.php add the course parameter &course='.$COURSE->id.':

      // Print messaging link if allowed
      if (isloggedin() && has_capability('moodle/site:sendmessage', $usercontext)
      && !empty($CFG->messaging) && !isguestuser() && !isguestuser($user) && ($USER->id != $user->id)) {
      echo '<div class="messagebox">';
      echo '<a href="'.$CFG->wwwroot.'/message/index.php?id='.$user->id.'&course='.$COURSE->id.'">'.get_string('messageselectadd').'</a>';
      echo '</div>';

      Finally in the file message/index.php add these lines:

      $id = optional_param('course','',PARAM_TEXT);
      $courselang = $DB->get_field('course','lang',array('id'=>$id));
      $SESSION->lang = $courselang;

            marina Marina Glancy
            amrigo Angelo Rigo (Inactive)
            Rajesh Taneja Rajesh Taneja
            Dan Poltawski Dan Poltawski
            Damyon Wiese Damyon Wiese
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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