Hi,
I have used the code below hundreds of times in Silverstripe. Just trying to pass in a limit to a function to decide how many items to chow in the template:
public function News($limit=0) {
if($limit!=0)
return DataObject::get("NewsPage", "", 'Date DESC', "", $limit);
else
return DataObject::get("NewsPage", "", 'Date DESC', "", "");
}
Since I've been working in 2.4.1, I get the following error:
[Notice] Object of class SS_HTTPRequest could not be converted to int
On this line:
if($limit!=0)
WHY? What is wrong with this code?
Thanks,
Garrett