Moodle
  1. Moodle
  2. MDL-29406

unset_all_config_for_plugin() deletes too much!

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0, 2.1
    • Fix Version/s: 2.0.5, 2.1.2
    • Component/s: Administration
    • Labels:
    • Testing Instructions:
      Hide

      for developers:
      1/ create some fake report settings: set_config('report_haha_ddd', 1); set_config('report_hahaha_xxx', 1);
      2/ execute function with "report_haha" parameter and make sure only one is deleted

      Show
      for developers: 1/ create some fake report settings: set_config('report_haha_ddd', 1); set_config('report_hahaha_xxx', 1); 2/ execute function with "report_haha" parameter and make sure only one is deleted
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w37_MDL-29406_m22_configdelete
    • Rank:
      19116

      Description

      the problem is that "_" is a special character in LIKE, it might delete settings from plugin with similar name
      unset_all_config_for_plugin('xxx_plugin') deletes config data of 'xxx_pluginator'

      1. testscript.php
        0.6 kB
        Aparup Banerjee

        Activity

        Hide
        Petr Škoda added a comment -

        to integrators: please cherry pick to all 2.x branches

        Show
        Petr Škoda added a comment - to integrators: please cherry pick to all 2.x branches
        Hide
        Sam Hemelryk added a comment -

        Thanks Petr, this has been integrated now

        Show
        Sam Hemelryk added a comment - Thanks Petr, this has been integrated now
        Hide
        Aparup Banerjee added a comment -

        this works for me. (attached test script)

        Show
        Aparup Banerjee added a comment - this works for me. (attached test script)
        Hide
        Eloy Lafuente (stronk7) added a comment -

        And this code has been spread to all Moodle git and cvs repositories. Many thanks! Closing.

        Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - And this code has been spread to all Moodle git and cvs repositories. Many thanks! Closing. Ciao

          People

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

            Dates

            • Created:
              Updated:
              Resolved: