Moodle
  1. Moodle
  2. MDL-26825

mform->get_data() return true when a form is cancelled

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.0.3
    • Component/s: Forms Library
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      16775

      Description

      If a developer does a get_data() test before is_cancelled(), get_data will return true rather than reflecting the fact the form was cancelled.

      Steps to reproduce:

      1) Install attached test script in Moodle root
      2) Call http://mymoodle/testmformscancel.php
      3) Press the cancel button

      Expected Result
      ---------------
      'got cancelled' is printed.

      Actual Result
      -------------
      'got data' is printed

      A proof of concept patch is available here:
      https://git.luns.net.uk/?p=moodle.git;a=commitdiff;h=1aabc1ca4772b4a6677f936db2b25f19de8eb89c

        Activity

        Hide
        Petr Škoda added a comment -

        Oh, I missed the linked patch. Thanks for the report and patch.

        Petr

        Show
        Petr Škoda added a comment - Oh, I missed the linked patch. Thanks for the report and patch. Petr
        Hide
        Helen Foster added a comment -

        Thanks Dan and Petr.

        Show
        Helen Foster added a comment - Thanks Dan and Petr.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: