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

Support multilang for custom field category names

XMLWordPrintable

    • MOODLE_401_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-77180-401
    • Hide
      1. Log in as admin
      2. Navigate to Plugins > Filters > Manage filters in site administration
      3. Set Multi-language content to On and Apply to: Content and headings
      4. Navigate to Courses > Course custom fields in site administration
      5. Press Add new category
      6. Press Edit category name for the new category
      7. Set the value to the following, and press enter when finished:

        <span class="multilang" lang="en">Category (EN)</span><span class="multilang" lang="de">Category (DE)</span>
        

      8. Confirm the category name is displayed only as Category (EN)
      9. Press Edit category name again
      10. Confirm the multilang string you previously entered is shown
      11. Press escape to cancel
      12. Add a new custom field to the category you created
      13. Navigate to Courses > Add a new course in site administration
      14. Scroll to the end of the form
      15. Confirm the category name is displayed only as Category (EN)
      Show
      Log in as admin Navigate to Plugins > Filters > Manage filters in site administration Set Multi-language content to On and Apply to: Content and headings Navigate to Courses > Course custom fields in site administration Press Add new category Press Edit category name for the new category Set the value to the following, and press enter when finished: <span class="multilang" lang="en">Category (EN)</span><span class="multilang" lang="de">Category (DE)</span> Confirm the category name is displayed only as Category (EN) Press Edit category name again Confirm the multilang string you previously entered is shown Press escape to cancel Add a new custom field to the category you created Navigate to Courses > Add a new course in site administration Scroll to the end of the form Confirm the category name is displayed only as Category (EN)

      Moodle sites can have course custom fields and admins can categorize fields and name categories.

      The default category names are obtained from the lang pack, but multilang tags for custom category names are dropped by PARAM_NOTAGS in core_customfield_inplace_editable().

      Replacing the line:

              $newvalue = clean_param($newvalue, PARAM_NOTAGS);

      with the line:

              $newvalue = clean_param($newvalue, PARAM_TEXT);

      will fix the problem.

      Reproduction Steps:

      1. Make sure multilang filter is enabled and a lang pack (say German) is installed.
      2. Open Course custom fields page by "Site administration" > "Courses" tab > "Course custom fields".
      3. Click "Add a new category" button.
      4. Click "Other fields" and type "<span class="multilang" lang="en">Example</span><span class="multilang" lang="de">Beispiel</span>", then Enter.
      5. You see the category name is "ExampleBeispiel".

            pholden Paul Holden
            kagotani Hiroto Kagotani
            Carlos Escobedo Carlos Escobedo
            Amaia Anabitarte Amaia Anabitarte
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 35 minutes
                3h 35m

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