• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [fixed] 1.10 Beta API Docs: CMSModule::SetPreference() do
PostPosted: Tue Oct 18, 2011 9:22 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Sun Jul 27, 2008 1:36 am
Posts: 218
Location: USA
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:
/**
 * 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


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: 1.10 Beta API Docs: CMSModule::SetPreference() doc error
PostPosted: Fri Oct 21, 2011 5:49 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Apr 23, 2008 7:53 am
Posts: 7661
Location: The Netherlands
Calguy fixed this

_________________
Image

Did my post help you solving a problem at your (customers) website and it saved you many hours of work? Great!! Consider buying me a cup of coffee in return!



Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting