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

New format_text option to exclude particular filters

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.8.6, 2.9
    • 3.0
    • Filters
    • MOODLE_28_STABLE, MOODLE_29_STABLE
    • MOODLE_30_STABLE
    • Hide

      The unit tests test the format_text changs quite well.

      The bit that needs manual testsing is the new admin settings class.

      1. Go into any plugin, and edit its settings.php file. Add some code like the example below somewhere.
      2. Go to Admin -> Notifications. Verify that you are prompted to set the new setting, and that the default is right.
      3. Change the setting and verify (by finding the setting in the admin tree) that the value was saved correctly.

      $settings->add(new admin_setting_pickfilters('thisisatest', 'Choose some filters',
              'This is a test', array('urltolink' => 1, 'emoticon' => 1)));
      

      Show
      The unit tests test the format_text changs quite well. The bit that needs manual testsing is the new admin settings class. Go into any plugin, and edit its settings.php file. Add some code like the example below somewhere. Go to Admin -> Notifications. Verify that you are prompted to set the new setting, and that the default is right. Change the setting and verify (by finding the setting in the admin tree) that the value was saved correctly. $settings ->add( new admin_setting_pickfilters( 'thisisatest' , 'Choose some filters' , 'This is a test' , array ( 'urltolink' => 1, 'emoticon' => 1)));

    Description

      We have a need in one of our plugins to have calls to format_text no apply a particular filter.

      So, we want to add a new option 'disablefilters' => 'urltolink,glossary' in the $options array for format_text.

      At the same time, I will make a new admin_setting_filter_types admin_setting class, since any time you use this new API, you probably want it to be configurable.

      Forum discussion https://moodle.org/mod/forum/discuss.php?d=314695

      Attachments

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              timhunt Tim Hunt
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              David Monllaó David Monllaó
              Mark Nelson Mark Nelson
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                16/Nov/15