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

validate_data for events should be called only with debugdeveloper

    XMLWordPrintable

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.7
    • BACKEND
    • Events API
    • MOODLE_27_STABLE
    • MDL-45051-master
    • Hide
      1. Add following code to core\event\course_module_viewed::validate_data() (as the first line)

                throw new \coding_exception('MDL-45051');
        

      2. Add this config to your config file
        $CFG->debug = 0;
      3. Visit any course module that triggers the above event, ex:- Glossary
      4. Make sure no error is seen.
      5. Add this to your config.php
        $CFG->debug = 32767;
      6. Visit the module again and make sure an exception is thrown.
      Show
      Add following code to core\event\course_module_viewed::validate_data() (as the first line) throw new \coding_exception('MDL-45051'); Add this config to your config file $CFG->debug = 0; Visit any course module that triggers the above event, ex:- Glossary Make sure no error is seen. Add this to your config.php $CFG->debug = 32767; Visit the module again and make sure an exception is thrown.

    Description

      Calling validate_data() is not required for production installs, it is a developer thing and should be done only when debug developer is on.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ankit_frenz Ankit Agarwal
              Petr Skoda Petr Skoda
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: