Fatal error: Class 'mosAlberghiClient' not found

Discussion and education for beginner / novice programmers interested in embarking on the development process to take advantage of the extensible nature of the Joomla! CMS.
Locked
jim11
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Aug 20, 2008 1:30 pm

Fatal error: Class 'mosAlberghiClient' not found

Post by jim11 » Wed Aug 20, 2008 1:56 pm

Hello,

I have adopted com_registration component in a way that some additional elements are added in form and stored in alberghi_client table (from alberghi component).

That worked perfectly until host provider did server upgrade (Apache 1 -> 2.2.9 (Unix), PHP 4 -> 5.2.6), and after that fatal error occurs:
Class 'mosAlberghiClient' not found in /home/croatiad/public_html/components/com_registration/registration.php on line 164

In attachment you can find registration.php file, where adaptation can be seen.
This code has been copied from alberghi component to registration.php:

Code: Select all

// Class: mosAlberghiClient
class mosAlberghiClient extends mosDBTable {

//************************************************************
// Declare variables to store data
//************************************************************
var $id=null;
var $name=null;
var $contact=null;
var $address=null;
var $town=null;
var $county=null;
var $country=null;
var $postcode=null;
var $email=null;
var $website=null;
var $websiteDescription=null;
var $telephone=null;
var $fax=null;
var $extrainfo=null;
var $checked_out=null;
var $checked_out_time=null;
var $editor=null;

// Function: mosAlberghiClient
function mosAlberghiClient( &$db ) {
$this->mosDBTable( '#__alberghi_client', 'id', $db );
}

// Function: Check
function check() {

// check for valid name
if (trim( $this->name ) == '') {
  $this->_error = "Devi inserire un nome.";
  return false;
}

return true;
}
}
//***********************************************************
// Function: saveClient
//***********************************************************
function saveClient( &$database ) {
// Initialise a new row
$row = new mosAlberghiClient( $database );

// Bind the values submitted to the row
if (!$row->bind( $_POST )) {
return $database->getErrorMsg();
}

// Check the row
if (!$row->check()) {
return $database->getErrorMsg();
}
                        $row->contact = $row->name;
// Store the row
if (!$row->store()) {
return $database->getErrorMsg();
}

// Check in the row
$row->checkin($id);

// Return success
return NULL;
}
//***********************************************************
// Function: saveClient - END
//***********************************************************
error occurs at line: $row = new mosAlberghiClient( $database );

This same class still works under alberghi component, and registration component works if this add-on is removed.

I hope I have explained my problem a little bit.

Any help is welcome.
You do not have the required permissions to view the files attached to this post.
Last edited by jim11 on Sat Aug 23, 2008 9:29 am, edited 1 time in total.

 
jim11
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Aug 20, 2008 1:30 pm

Re: Fatal error: Class 'mosAlberghiClient' not found

Post by jim11 » Fri Aug 22, 2008 6:49 pm

Not even a tip?!?
:( :( :(

jim11
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Aug 20, 2008 1:30 pm

Re: Fatal error: Class 'mosAlberghiClient' not found

Post by jim11 » Sat Aug 23, 2008 9:28 am

Solved!

Moved class declaration from registration.php to registration.html.php and it worked!

I do not know why the error occured, because it worked fine for few months in registration.php.

Bye...

 

Locked

Return to “Joomla! Coding 101”