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

multiselect mform element default and returned value are not working as expected

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2, 2.3.6, 2.4.3
    • Fix Version/s: 2.3.7, 2.4.4
    • Component/s: Forms Library
    • Labels:
    • Testing Instructions:
      Hide
      1. Find some multiple select fields `git grep setMultiple`, AND some normal selects dropdowns
      2. Confirm that they work as expected
        • Data saved
        • Defaults are correct
        • Defaults don't override data submitted
      3. Download the attached file test_form_data.php
      4. Play with the form settings
      5. Confirm that
        • You can set default values on the single select and multiple select
        • The submitted value is selected whatever default value has been set
        • When none of the elements of the multiple select are selected, nothing is selected
      Show
      Find some multiple select fields `git grep setMultiple`, AND some normal selects dropdowns Confirm that they work as expected Data saved Defaults are correct Defaults don't override data submitted Download the attached file test_form_data.php Play with the form settings Confirm that You can set default values on the single select and multiple select The submitted value is selected whatever default value has been set When none of the elements of the multiple select are selected, nothing is selected
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-30940-master

      Description

      Attached are two examples of tiny mform using multiselect
      In the first example (copy it to your moodle root (in $CFG->wwwroot)) defaults are not working.

      In the second... defaults are working at 50% but what is worse is that by taking each selection off (shift click) and submitting the form, defualts are still submitted.

      Please help me!!!!

        Attachments

        1. select_one.php
          1 kB
        2. select_two.php
          1 kB
        3. test_form_data.php
          1 kB

          Issue Links

            Activity

              People

              Assignee:
              fred Frédéric Massart
              Reporter:
              daniss Daniele Cordella
              Peer reviewer:
              Daniele Cordella
              Integrator:
              Damyon Wiese
              Tester:
              Rossiani Wijaya
              Participants:
              Component watchers:
              Jake Dallimore, Jun Pataleta
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/May/13