Moodle
  1. Moodle
  2. MDL-18432

get_user_preferences needs to read from a config file?

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Inactive
    • Affects Version/s: 1.9.4
    • Fix Version/s: None
    • Component/s: Documentation, Libraries
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE

      Description

      While attempting to set the "message_blocknoncontacts" preference default in Moodle code, it occured to me that default values for preferences are hard-coded whenever get_user_preferences is called (The function is defined on line 1024 in lib/moodlelib.php for reference). What I'd like to see, is the gradual move away from hard-coded preferences, and instead using a "config" file which contains the preference defaults. For example, calling get_user_preferences could look like this:

      get_user_preferences("message_blocknoncontacts", $DEFAULTS->blocknoncontacts);

      instead of this:

      get_user_preferences("message_blocknoncontacts", 0);

      I think a few people would find this VERY handy, because there are times when you want to change default Moodle options but need to hunt around for it. Plus it could pave the way for integrating this into the Roles system or the general site config or something like that.

        Gliffy Diagrams

          Activity

          Hide
          Helen Foster added a comment -

          David, thanks for your report. Reassigning to lib component lead, moodle.com, for consideration.

          Show
          Helen Foster added a comment - David, thanks for your report. Reassigning to lib component lead, moodle.com, for consideration.
          Hide
          Mark Ward added a comment -

          This seems to have been a concern since Moodle 1.5 and it's still an issue in Moodle 2.0.3, being unable to change such default settings without hacking core code is not a minor problem for a production site.

          Show
          Mark Ward added a comment - This seems to have been a concern since Moodle 1.5 and it's still an issue in Moodle 2.0.3, being unable to change such default settings without hacking core code is not a minor problem for a production site.
          Hide
          Marina Glancy added a comment -

          We have detected that this issue has been inactive for over two years and also did not collect many votes. It is possible that it has been already implemented in a more recent version of Moodle, or it is not highly demanded. There are unlimited number of ways Moodle functinality can be expanded and improved but we would like to concentrate on the features that will benefit majority of users, and which can not be implemented as plugins. If you have a suggestion for improving Moodle core, and there is no open issue for it in the tracker, please start a new forum discussion to see how many other users agree with you, and then create a new issue providing as many details as possible.

          ==BLK2YIMP20141121==

          Show
          Marina Glancy added a comment - We have detected that this issue has been inactive for over two years and also did not collect many votes. It is possible that it has been already implemented in a more recent version of Moodle, or it is not highly demanded. There are unlimited number of ways Moodle functinality can be expanded and improved but we would like to concentrate on the features that will benefit majority of users, and which can not be implemented as plugins. If you have a suggestion for improving Moodle core, and there is no open issue for it in the tracker, please start a new forum discussion to see how many other users agree with you, and then create a new issue providing as many details as possible. ==BLK2YIMP20141121==

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: