By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,566 Members | 1,785 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,566 IT Pros & Developers. It's quick & easy.

Fatal error: Call to a member function on a non-object

P: 1
Can anyone please guide me as to how to fix the below mentioned problem from php

...
Fatal error: Call to a member function on a non-object in /usr/local/apache2/htdocs/knowledgeTree-OSS/lib/browse/DocumentCollection.inc.php on line 414


/////////////////

The code is as follows...
Expand|Select|Wrap|Line Numbers
  1. function setSorting() {
  2.     387
  3.     388         $this->_sorted = true;
  4.     389
  5.     390         // defaults
  6.     391         $this->_sDocumentSortField = 'DM.name';
  7.     392         $this->_sFolderSortField = 'F.name';
  8.     393
  9.     394         foreach ($this->columns as $key => $oColumn) {
  10.     395             if ($oColumn->namespace == $this->sort_column) {
  11.     396                 $this->columns[$key]->setSortedOn(true);
  12.     397                 $this->columns[$key]->setSortDirection($this->sort_order);
  13.     398
  14.     399                 // get the join params from the object.
  15.     400                 $aFQ = $this->columns[$key]->addToFolderQuery();
  16.     401                 $aDQ = $this->columns[$key]->addToDocumentQuery();
  17.     402
  18.     403                 $this->_sFolderJoinClause = $aFQ[0];
  19.     404                 $this->_aFolderJoinParams = $aFQ[1];
  20.     405
  21.     406                 if ($aFQ[2]) { $this->_sFolderSortField = $aFQ[2]; }
  22.     407                 $this->_sDocumentJoinClause = $aDQ[0];
  23.     408                 $this->_aDocumentJoinParams = $aDQ[1];
  24.     409
  25.     410                 if ($aDQ[2]) {
  26.     411                     $this->_sDocumentSortField = $aDQ[2]; }
  27.     412                 } else {
  28.     413                          /*   $oColumn->setSortedOn(false);*/
  29.     414                                 $oColumn->setSortedOn(false);
  30.     415                 }
  31.     416         }
  32.  
The problem is at line 414
Jul 23 '07 #1
Share this Question
Share on Google+
1 Reply


code green
Expert 100+
P: 1,726
You need to pass this object into your function
$oColumn
Jul 23 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.