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

Moodle form validation caches results for all objects.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.4, 3.1, 3.2
    • Fix Version/s: 3.0.7, 3.1.3
    • Component/s: Forms Library
    • Labels:

      Description

      In validate_defined_fields() it uses

      static $validated = null; // one validation is enough

      However, we can have more than one form being validated, I believe this $validated should me an instance variable, not static.

      Please see my solution for a phpunit test showing the problem.

        Attachments

          Activity

            People

            Assignee:
            roperto Daniel Thee Roperto
            Reporter:
            roperto Daniel Thee Roperto
            Peer reviewer:
            Adrian Greeve
            Integrator:
            Eloy Lafuente (stronk7)
            Tester:
            CiBoT
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              14/Nov/16