Project

General

Profile

Actions

Defect #7104

open

Accessing core Setting.* values in a plugin's init causes the plugin's settings to not load

Added by Robert Chady over 13 years ago. Updated over 13 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Plugin API
Target version:
-
Start date:
2010-12-13
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

If you access a core value from Setting, such as host_name from a plugin's init.rb, then the plugin's settings will not be properly loaded.

To reproduce, create a simple plugin that does something like:

myurl = Setting.host_name

and then add in some settings

settings :default => {
'myvar' => 'myval'
}, :partial => 'settings/mysettings'

And then try to access the configure page from Administration / Plugins. You can also go in to the console and try to access Setting.plugin_#{your_plugin_name} here -- you will see it is not available. Meanwhile, all aspects of your plugin work fine, other than the settings and anything that tries to reference the settings.

Actions

Also available in: Atom PDF