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

tyteen4a03

Well-known member
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?
 
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.
 
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:
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;

?
 
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...
 
Actually the XML file you're currently hosting on repo doesn't have that option...
 
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>
 
Back
Top Bottom