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

New format_text option to exclude particular filters

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8.6, 2.9
    • Fix Version/s: 3.0
    • Component/s: Filters
    • Testing Instructions:
      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)));
    • Affected Branches:
      MOODLE_28_STABLE, MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      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

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  16/Nov/15