[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
fredp
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
Rolf
Dev Team Member
Dev Team Member
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

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

Post by Rolf »

Calguy fixed this
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Post Reply

Return to “Closed Issues”