[fixed] 1.10 Beta API Docs: CMSModule::SetPreference() do

The members of the Dev team will place issues here that they consider to be solved.
Post Reply
Forum Members
Forum Members
Posts: 218
Joined: Sun Jul 27, 2008 1:36 am
Location: USA

[fixed] 1.10 Beta API Docs: CMSModule::SetPreference() do

Post by fredp »

There is an error in the 1.10 API docs. The CMSModule::SetPreference() method is documented as returnsing a boolean value:
boolean SetPreference (string $preference_name, string $value)

But, in looking at the code, it seems that the return value will always be NULL since the cms_siteprefs::set() method used to implement it has no return statement and is documented as returning "void":

Code: Select all

 * Sets the given site perference with the given value.
 * @since 0.6
 * @param string The preference name
 * @param mixed  The preference value (will be stored as a string)
 * @return void
function set_site_preference($prefname, $value)
  return cms_siteprefs::set($prefname,$value);
See: cms_siteprefs::set()

While it would be nice if there were a useful boolean value returned from CMSModule::SetPreference(), if that isn't possible at this point in the 1.10 release cycle, then the docs should at least be updated to note the problem and/or reflect reality.
Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln
User avatar
Dev Team Member
Dev Team Member
Posts: 7768
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands

Re: 1.10 Beta API Docs: CMSModule::SetPreference() doc error

Post by Rolf »

Calguy fixed this
- + - + - + - + - + -
Latest CMSMS tutorial: FormBuilder WatchGuard
- + - + - + - + - + -
Did my post help you solving a problem at your (customers) website and it saved you many hours of work?
Great!! Buy me a cup of coffee in return as a small token of appreciation!
Post Reply

Return to “Closed Issues”