Moodle
  1. Moodle
  2. MDL-27168

Block Course completion: in the "more details" page of this block students doesn't see properly "Yes" in the "Completed" field when they are using another language, different than English

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.4, 2.1.1
    • Component/s: Blocks
    • Labels:
      None
    • Environment:
      Applicable for all environments
    • Testing Instructions:
      Hide

      1/ Use a non-english language
      2/ Enable course compeltion for a course
      3/ Add the compeition status block
      4/ Look at the 'more details' page of course compeition
      5/ Notice the english 'yes/no' strings

      Show
      1/ Use a non-english language 2/ Enable course compeltion for a course 3/ Add the compeition status block 4/ Look at the 'more details' page of course compeition 5/ Notice the english 'yes/no' strings
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      16784

      Description

      The bug is located in the Course completion block

      In the "more details" page of this block students doesn't see properly "Yes" in the "Completed" field when they are using another language, different than English (i.e. Spanish).

      The problem is in the code of the "blocks/completionstatus/details.php" file, in line 235. Just make the next change to let this bug closed:
      WRONG file shows:
      echo ($row['status'] === 'Yes') ? 'Yes' : 'No';
      RIGHT file shows:
      echo ($row['status'] === get_string('yes')) ? get_string('yes') : get_string('no');

      1. details.php
        7 kB
        Alberto Hernáiz González

        Activity

        Hide
        Alberto Hernáiz González added a comment -

        The file with the right code

        Show
        Alberto Hernáiz González added a comment - The file with the right code
        Hide
        Dan Poltawski added a comment -

        Thanks Alberto, i've submitted the fix for integration

        Show
        Dan Poltawski added a comment - Thanks Alberto, i've submitted the fix for integration
        Hide
        Sam Hemelryk added a comment -

        Thanks Dan this has been integrated now.

        Cheers
        Sam

        Show
        Sam Hemelryk added a comment - Thanks Dan this has been integrated now. Cheers Sam
        Hide
        Marina Glancy added a comment -

        When I login as a student and course has a block 'course completion status', I can not open a course page:

        Field "courseid" does not exist in table "user_enrolments"
        Stack trace:
        line 508 of /lib/dml/moodle_database.php: dml_exception thrown
        line 1297 of /lib/dml/moodle_database.php: call to moodle_database->where_clause()
        line 93 of /lib/completion/completion_criteria_duration.php: call to moodle_database->get_field()
        line 156 of /lib/completion/completion_criteria_duration.php: call to completion_criteria_duration->get_timeenrolled()
        line 208 of /lib/completion/completion_criteria_completion.php: call to completion_criteria_duration->get_status()
        line 145 of /blocks/completionstatus/block_completionstatus.php: call to completion_criteria_completion->get_status()
        line 280 of /blocks/moodleblock.class.php: call to block_completionstatus->get_content()
        line 232 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
        line 899 of /lib/blocklib.php: call to block_base->get_content_for_output()
        line 951 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 7 of /theme/base/layout/general.php: call to block_manager->region_has_content()
        line 650 of /lib/outputrenderers.php: call to include()
        line 608 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
        line ? of unknownfile: call to core_renderer->header()
        line 1279 of /lib/setuplib.php: call to call_user_func_array()
        line ? of unknownfile: call to bootstrap_renderer->__call()
        line 196 of /course/view.php: call to bootstrap_renderer->header()

        Show
        Marina Glancy added a comment - When I login as a student and course has a block 'course completion status', I can not open a course page: Field "courseid" does not exist in table "user_enrolments" Stack trace: line 508 of /lib/dml/moodle_database.php: dml_exception thrown line 1297 of /lib/dml/moodle_database.php: call to moodle_database->where_clause() line 93 of /lib/completion/completion_criteria_duration.php: call to moodle_database->get_field() line 156 of /lib/completion/completion_criteria_duration.php: call to completion_criteria_duration->get_timeenrolled() line 208 of /lib/completion/completion_criteria_completion.php: call to completion_criteria_duration->get_status() line 145 of /blocks/completionstatus/block_completionstatus.php: call to completion_criteria_completion->get_status() line 280 of /blocks/moodleblock.class.php: call to block_completionstatus->get_content() line 232 of /blocks/moodleblock.class.php: call to block_base->formatted_contents() line 899 of /lib/blocklib.php: call to block_base->get_content_for_output() line 951 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 7 of /theme/base/layout/general.php: call to block_manager->region_has_content() line 650 of /lib/outputrenderers.php: call to include() line 608 of /lib/outputrenderers.php: call to core_renderer->render_page_layout() line ? of unknownfile: call to core_renderer->header() line 1279 of /lib/setuplib.php: call to call_user_func_array() line ? of unknownfile: call to bootstrap_renderer->__call() line 196 of /course/view.php: call to bootstrap_renderer->header()
        Hide
        Sam Hemelryk added a comment -

        Restarting testing

        Show
        Sam Hemelryk added a comment - Restarting testing
        Hide
        Marina Glancy added a comment -

        sorry, that was separate bug, created an issue MDL-28248
        I'll continue testing

        Show
        Marina Glancy added a comment - sorry, that was separate bug, created an issue MDL-28248 I'll continue testing
        Hide
        Marina Glancy added a comment -

        tested only in 2.1 because 2.0 has another bug that does not allow to test

        Show
        Marina Glancy added a comment - tested only in 2.1 because 2.0 has another bug that does not allow to test
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Incorporated upstream, thanks!

        Show
        Eloy Lafuente (stronk7) added a comment - Incorporated upstream, thanks!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: