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

Custom fields of type dropdown don't format their options consistently

XMLWordPrintable

    • MOODLE_403_STABLE, MOODLE_404_STABLE
    • MOODLE_403_STABLE, MOODLE_404_STABLE
    • MDL-82481-403
    • MDL-82481-404
    • Hide

      Custom fields

      1. Covered by existing unit tests

      Report builder

      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. Create a new Dropdown menu custom field
        • Name: Multilang
        • Short name: multilang
        • Menu options:

          <span lang="en" class="multilang">Beginner</span> <span lang="es" class="multilang">Novato</span>
          <span lang="en" class="multilang">Intermediate</span> <span lang="es" class="multilang">Intermedio</span>
          <span lang="en" class="multilang">Advanced</span> <span lang="es" class="multilang">Avanzado</span>
          

      6. Create a new course
        • Multilang: Intermediate
      7. Navigate to /course/index.php
      8. Confirm you see "Multilang: Intermediate" for your new course
      9. Navigate to Reports from user menu
      10. Create a new report from Courses report source
        • Include default setup: Yes
      11. Add the Course > Multilang column to the report
      12. Confirm the Multilang column shows "Intermediate"
      13. Add the Course > Multilang condition to the report
      14. Set Multilang condition to Is equal to
      15. Confirm the options are:
        • <empty>
        • Beginner
        • Intermediate
        • Advanced
      16. Select Intermediate and press Apply
      17. Confirm your new course is still shown in report
      Show
      Custom fields Covered by existing unit tests Report builder 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 Create a new Dropdown menu custom field Name: Multilang Short name: multilang Menu options: <span lang="en" class="multilang">Beginner</span> <span lang="es" class="multilang">Novato</span> <span lang="en" class="multilang">Intermediate</span> <span lang="es" class="multilang">Intermedio</span> <span lang="en" class="multilang">Advanced</span> <span lang="es" class="multilang">Avanzado</span> Create a new course Multilang: Intermediate Navigate to /course/index.php Confirm you see "Multilang: Intermediate" for your new course Navigate to Reports from user menu Create a new report from Courses report source Include default setup: Yes Add the Course > Multilang column to the report Confirm the Multilang column shows "Intermediate" Add the Course > Multilang condition to the report Set Multilang condition to Is equal to Confirm the options are: <empty> Beginner Intermediate Advanced Select Intermediate and press Apply Confirm your new course is still shown in report

      When a Dropdown customfield contains formatted options (e.g. those containing multi-language tags), then we don't currently have a consistent/re-usable way of formatting them

      1. The editing form manually formats each option;
      2. The options are generated here

      The latter method is already dealing with string parsing, so it should also perform the string formatting and allow for callers to re-use it instead of having to duplicate the same code manually themselves

      This affects Report builder reports as follows:

      Note that the column is correctly formatted, but the conditions options are not

      We have a similar problem in the Workplace catalogue at WP-4965, we should be able to use the fix here to resolve that

            pholden Paul Holden
            pholden Paul Holden
            Pedro Jordao Pedro Jordao
            David Carrillo David Carrillo
            Kim Jared Lucas Kim Jared Lucas
            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 - 56 minutes
                56m

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