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

checkbox field cannot be unchecked

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.6.9, 1.7.7, 1.8.8, 1.9.4
    • 1.9.5, 2.0
    • None
    • MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
    • MOODLE_19_STABLE, MOODLE_20_STABLE

    Description

      If I setup a checkbox, whether it has one or more options is not important.. When I create new record or edit record that no checkbox in that checkbox group was set, all checkboxes are unchecked as expected. If I check any on, the setting is saved.

      What I can't do is to uncheck again all checkboxes. After saving the record with all checkboxes unchecked, the last checked checkxbox comes back on. It seems that database module is unable to save checkbox content that is empty. It insists to have at least one entry saved, that is one checkbox checked.

      I don't know whether the data module should be saving empty field content in this case or whether unchecking all checkboxes should delete the checkbox entry from data_content table..

      In any case, this is a blocker for using checkbox field since the point of that field is not be on or off.

      Attachments

        1. MDL-18542-reverting-howard-19_STABLE.patch
          11 kB
          David Mudrák (@mudrd8mz)
        2. MDL-18542-simple-fix.patch
          0.7 kB
          David Mudrák (@mudrd8mz)

        Issue Links

          Activity

            People

              howardsmiller Howard Miller
              robek Robert Brenstein
              Petr Skoda Petr Skoda
              Jake Dallimore, Mathew May, Mihail Geshoski
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                13/May/09