• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XenForo_Application::getOptions()->get() returns.. null?

tyteen4a03

Well-known member
#1
It's 2:30am so I have no idea what I am missing.

Since I attempted to add caching, my addon broke. When I tried to track down the cause, I came to this line, and I found out that the value for get(anything) is null.

Did I break XF?
 

Chris D

XenForo developer
Staff member
#2
I'm not sure what the use case for XenForo_Application::getOptions is, but I have noticed the same behaviour.

XenForo_Application::get('options')->option_id works globally.
 

tyteen4a03

Well-known member
#3
I'm not sure what the use case for XenForo_Application::getOptions is, but I have noticed the same behaviour.

XenForo_Application::get('options')->option_id works globally.
Which is strange because getOptions is just a shorthand for get('options'). Even xF use getOptions internally.
 
Last edited:

Chris D

XenForo developer
Staff member
#4
Yeah I thought it was odd at the time.

But I switched it back to what I normally use and it started working.

Does it make any difference if you use:

XenForo_Application::getOptions()->yourOptionId;

or

XenForo_Application::get('options')->yourOptionId;

?
 

tyteen4a03

Well-known member
#5
Yeah I thought it was odd at the time.

But I switched it back to what I normally use and it started working.

Does it make any difference if you use:

XenForo_Application::getOptions()->yourOptionId;

or

XenForo_Application::get('options')->yourOptionId;

?
No difference. Still null. However this time boardActive do return 1.

I don't understand this because as you can see in the XML file I exported, 3ps_cmfu_useCache does exist...
 

Chris D

XenForo developer
Staff member
#8
It's a typo. Your option_id in XML is 3ps_cufm_useCache not 3ps_cmfu_useCache
Yep :)

Code:
<option option_id="3ps_cufm_useCache" edit_format="onoff" data_type="boolean" can_backup="1">
<default_value>1</default_value>
<edit_format_params></edit_format_params>
<sub_options></sub_options>
<relation group_id="3ps_cmfu" display_order="2"/>
</option>