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

Multilang bug Glossary/FAQ category names

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.3, 2.1, 2.2
    • Fix Version/s: 2.1.1
    • Component/s: Filters, Glossary
    • Labels:
    • Testing Instructions:
      Hide
      1. Enable multilang filter for headings and contents
      2. Create one glossary and add some categories using valid multilang syntax
      3. TEST: All the add/modify/delete categories interface must show the category names with the multilang filter applied
      4. Add some entries, picking categories for them
      5. TEST: The categories in the entry form are shown with the multilang filter applied
      6. Go to the "Categories" tab
      7. TEST: The categories on the right menu are shown with the multilang filter applied
      8. In the same "Categories" tab, pick the "All categories" element in the right menu
      9. TEST: The entries are shown with the categories displayed as "separation" with the multilang filter applied
      10. Click the little printer icon (upper-right) in the same page
      11. TEST: The print view shows the same info than the previous page with categories displayed as "separation" with the multilang filter applied
      Show
      Enable multilang filter for headings and contents Create one glossary and add some categories using valid multilang syntax TEST: All the add/modify/delete categories interface must show the category names with the multilang filter applied Add some entries, picking categories for them TEST: The categories in the entry form are shown with the multilang filter applied Go to the "Categories" tab TEST: The categories on the right menu are shown with the multilang filter applied In the same "Categories" tab, pick the "All categories" element in the right menu TEST: The entries are shown with the categories displayed as "separation" with the multilang filter applied Click the little printer icon (upper-right) in the same page TEST: The print view shows the same info than the previous page with categories displayed as "separation" with the multilang filter applied
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      glossary_multilang_master

      Description

      Using "FAQ" in glossary module, the new created categories cannot be displayed correctly in multiple languages using multilang filter. (<span class="multilang" lang="en">...</span> ....)
      In the heading, it shows the hole code.
      In the drop-down box, it shows all languages one after another (but without code).

      ####################
      UPDATE (28 June 11):
      ####################

      Screenshot 1: Shows the category drop-down-box on the right with both languages one after another; in addition, you can see the chosen category in the middle showing the hole code. To fix both of these bugs, add some "format_string()" to /mod/glossary/lib.php

      line 1675: $menu[$url] = clean_text(format_string($currentcategory->name));

      line 1683: echo format_text(format_string($category->name), FORMAT_PLAIN);

      (Attention: These lines are refering to the glossary module version 2010111501. In older or newer versions, the lines may differ!)

      Screenshot 2: When editing categories, the overview shows the hole multilang code. In addition, if you try to delete a category, the confirmation page also shows the hole code. Both bugs can also be fixed with some format_string() calls added to /mod/glossary/editcategories.php

      line 218: echo "<span class=\"bold\">".format_text(format_string($category->name), FORMAT_PLAIN)."</span> <span>($num_entries " . get_string("entries","glossary") . ")</span>";

      line 121: echo "<div class=\"boxaligncenter deletecatconfirm\">".format_text(format_string($category->name), FORMAT_PLAIN)."<br/>";

      (Attention: These lines are refering to the glossary module version 2010111501. In older or newer versions, the lines may differ!)

      Screenshot 3: The category headings also show all languages one after another. I didn't find a fix for that until now.

        Gliffy Diagrams

          Attachments

          1. screen1.JPG
            screen1.JPG
            35 kB
          2. screen2.JPG
            screen2.JPG
            17 kB
          3. screen3.JPG
            screen3.JPG
            33 kB

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  1/Aug/11