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

Cache store add instance form validation doesn't handle errors well at all!

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4.1
    • Component/s: Caching
    • Labels:
    • Testing Instructions:
      Hide

      There is no real good way to test this in core presently as its unused.
      However the following can be done:

      1. Install XCache and enable it by giving it a positive xcache.var_size value.
      2. Install the XCache plugin from here https://github.com/samhemelryk/moodle-cachestore_xcache
      3. Log in as an admin
      4. Browse to Settings > Plugins > Caching > Configuration
      5. Add an XCache instance, give it a name that is not unique, and give it the prefix test.
      6. Check you get an error about the name not being unique when you try to submit.
      Show
      There is no real good way to test this in core presently as its unused. However the following can be done: Install XCache and enable it by giving it a positive xcache.var_size value. Install the XCache plugin from here https://github.com/samhemelryk/moodle-cachestore_xcache Log in as an admin Browse to Settings > Plugins > Caching > Configuration Add an XCache instance, give it a name that is not unique, and give it the prefix test. Check you get an error about the name not being unique when you try to submit.
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull Master Branch:
      wip-MDL-36939-m25

      Description

      When a cache store instances configuration is changed and the form values validated the instance callback to handle validation isn't given the current errors and then overwrites the errors array as its result.
      This means that duplicate names and such can get through validation and break a system if a cache store is being used that handles custom validation.

        Attachments

          Activity

            People

            Assignee:
            samhemelryk Sam Hemelryk
            Reporter:
            samhemelryk Sam Hemelryk
            Integrator:
            Dan Poltawski
            Tester:
            David Monllaó
            Participants:
            Component watchers:
            Matteo Scaramuccia, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              14/Jan/13