Moodle
  1. Moodle
  2. MDL-28048

Multilang bug Glossary/FAQ category names

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor 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
    • Rank:
      18029

      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.

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

        Activity

        Hide
        Michael de Raadt added a comment -

        Thanks for reporting that. You reported a problem with multi-lang strings for my contributed block, the Progress Bar block. Thanks for being so diligent with such testing.

        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 screenshots, replication instructions, fix test instructions, a workaround or even a code solution, will help us and other users.

        Show
        Michael de Raadt added a comment - Thanks for reporting that. You reported a problem with multi-lang strings for my contributed block, the Progress Bar block. Thanks for being so diligent with such testing. 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 screenshots, replication instructions, fix test instructions, a workaround or even a code solution, will help us and other users.
        Hide
        Dominik Jeni added a comment -

        Hi Michael!

        That's no problem!
        I've updated my post (see above) adding some screenshots and fix instructions.
        I hope this helps...

        Best regards,
        Dominik

        Show
        Dominik Jeni added a comment - Hi Michael! That's no problem! I've updated my post (see above) adding some screenshots and fix instructions. I hope this helps... Best regards, Dominik
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Thanks for the complete report! Working on it!

        Show
        Eloy Lafuente (stronk7) added a comment - Thanks for the complete report! Working on it!
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Hi, I'm submitting this for integration for 21_STABLE and master. I think I've fixed all the occurrences of categories so they now support the multilang properly (by configuring such setting to process both content and headings).

        Anyway, note I'm not happy at all with this sort of solution, as far as the rest of the glossary logic is not prepared to support those multilang strings 100%. Nor in categories, nor concepts, nor aliases. Surely it's a matter of do a serious analysis if this should become a "native" feature of the glossary instead of all these hacks that only makes it slower and prone to errors (for example, filters behavior against that type of contents, is not supported at all).

        Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Hi, I'm submitting this for integration for 21_STABLE and master. I think I've fixed all the occurrences of categories so they now support the multilang properly (by configuring such setting to process both content and headings). Anyway, note I'm not happy at all with this sort of solution, as far as the rest of the glossary logic is not prepared to support those multilang strings 100%. Nor in categories, nor concepts, nor aliases. Surely it's a matter of do a serious analysis if this should become a "native" feature of the glossary instead of all these hacks that only makes it slower and prone to errors (for example, filters behavior against that type of contents, is not supported at all). Ciao
        Hide
        Eloy Lafuente (stronk7) added a comment -

        21_STABLE and master (nasty hack, as commented above).

        Show
        Eloy Lafuente (stronk7) added a comment - 21_STABLE and master (nasty hack, as commented above).
        Hide
        Sam Hemelryk added a comment -

        Yay for more hacks - integrated anyway as it looks to fix the problem at hand, Thanks Eloy

        Show
        Sam Hemelryk added a comment - Yay for more hacks - integrated anyway as it looks to fix the problem at hand, Thanks Eloy
        Hide
        Rajesh Taneja added a comment -

        Works Great
        Thanks for providing the patch Eloy

        Show
        Rajesh Taneja added a comment - Works Great Thanks for providing the patch Eloy
        Hide
        Sam Hemelryk added a comment -

        Congratulations - this fix has just been released in the weeklies.

        Show
        Sam Hemelryk added a comment - Congratulations - this fix has just been released in the weeklies.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: