Moodle
  1. Moodle
  2. MDL-27833

can't search courses with non-latin characters during importing from other courses

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.3, 2.1, 2.2
    • Fix Version/s: 2.0.4, 2.1.1
    • Component/s: Backup
    • Labels:
    • Testing Instructions:
      Hide

      Replication:
      1. Create two courses named "测试1" and "测试2"
      2. Enter either course and click "import" in settings block
      3. Type "测试" in the search box and click search button
      4. No course matched

      Show
      Replication: 1. Create two courses named "测试1" and "测试2" 2. Enter either course and click "import" in settings block 3. Type "测试" in the search box and click search button 4. No course matched
    • Workaround:
      Hide

      I made a patch at https://github.com/hit-moodle/moodle/commit/534eebdd355785d6669bb19c2e08eefb299fe2e0

      I've tested it by using English & Chinese words.

      Show
      I made a patch at https://github.com/hit-moodle/moodle/commit/534eebdd355785d6669bb19c2e08eefb299fe2e0 I've tested it by using English & Chinese words.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Rank:
      17513

      Description

      Moodle is using PARAM_ALPHANUMEXT to filter the keyword. It should be PARAM_MULTILANG.

      In create/request course form, PARAM_MULTILANG is also used to filter fullname and shortname of courses.

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          Thanks for reporting this.

          I've put it on our backlog and we'll try to get to it as soon as we can.

          In the meantime adding more information, such as replication instructions, will help us and other users.

          Show
          Michael de Raadt added a comment - Thanks for reporting this. I've put it on our backlog and we'll try to get to it as soon as we can. In the meantime adding more information, such as replication instructions, will help us and other users.
          Hide
          Sunner Sun added a comment -

          Thanks. I just added Testing Instructions.

          Show
          Sunner Sun added a comment - Thanks. I just added Testing Instructions.
          Hide
          Dan Poltawski added a comment -

          Verified, tested and think this is good for integrating. Thanks a lot!

          Show
          Dan Poltawski added a comment - Verified, tested and think this is good for integrating. Thanks a lot!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Hi guys,

          this is correct, and works... but it's slightly incorrect!

          Note we should not be using PARAM_MULTILANG because it is deprecated, so we should be using PARAM_TEXT instead. But note that PARAM_TEXT is for contents expecting to have multilang strings, and definitively the course search is not going to have them. So, at the end, the best param to use is: PARAM_NOTAGS (it does 100% the same than the PARAM_MULTILANG/PARAM_TEXT for texts not having multilangs, aka, simple strip_tags().

          Please amend it and I'll be happy to integrate it!

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Hi guys, this is correct, and works... but it's slightly incorrect! Note we should not be using PARAM_MULTILANG because it is deprecated, so we should be using PARAM_TEXT instead. But note that PARAM_TEXT is for contents expecting to have multilang strings, and definitively the course search is not going to have them. So, at the end, the best param to use is: PARAM_NOTAGS (it does 100% the same than the PARAM_MULTILANG/PARAM_TEXT for texts not having multilangs, aka, simple strip_tags(). Please amend it and I'll be happy to integrate it! TIA and ciao
          Hide
          Sunner Sun added a comment -

          Ok, I will do that.

          But in course/edit_form.php and course/request_form.php, PARAM_MULTILANG is still used to filter course fullname and shortname. Should I patch them together?

          Show
          Sunner Sun added a comment - Ok, I will do that. But in course/edit_form.php and course/request_form.php, PARAM_MULTILANG is still used to filter course fullname and shortname. Should I patch them together?
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Ho S,

          nono, there are still deprecated uses for sure, just we don't want to introduce more. Thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Ho S, nono, there are still deprecated uses for sure, just we don't want to introduce more. Thanks!
          Hide
          Sunner Sun added a comment -

          Ok. Done!

          Please recheck, thanks

          Show
          Sunner Sun added a comment - Ok. Done! Please recheck, thanks
          Hide
          Eloy Lafuente (stronk7) added a comment -

          This has been integrated, thanks! (20, 21 and master)

          Show
          Eloy Lafuente (stronk7) added a comment - This has been integrated, thanks! (20, 21 and master)
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Passed. Tested with some accents and also the Chinese chars above added to some courses. Worked as expected!

          Show
          Eloy Lafuente (stronk7) added a comment - Passed. Tested with some accents and also the Chinese chars above added to some courses. Worked as expected!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          If there is a will, there is a way, and you found it! Thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - If there is a will, there is a way, and you found it! Thanks!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: