Steve Bartlett Posted August 23, 2014 Report Posted August 23, 2014 I am getting this error when I try to add an aircraft: Fatal error: Call to undefined method OperationsData::AddAircaft() in /home/xxxxxxx/public_html/admin/modules/Operations/Operations.php on line 720\ I am using the same skin I have used before with no problems, Both the PHPvms and website are php version 5.5 Here is Line 720 (which matches with what other websites have): OperationsData::AddAircaft($data); Quote
Members Vangelis Posted August 23, 2014 Members Report Posted August 23, 2014 Check if the function exists in core / common / OperationsData.class.php Quote
Steve Bartlett Posted August 23, 2014 Author Report Posted August 23, 2014 I think that is what I posted above This is line 720: OperationsData::AddAircaft($data); Quote
Members Vangelis Posted August 23, 2014 Members Report Posted August 23, 2014 this error comes from the module Fatal error: Call to undefined method OperationsData::AddAircaft() in /home/xxxxxxx/public_html/admin/modules/Operations/Operations.php on line 720\ i told you to go to folder core then to folder common and the open the OperationsData.class.php and see if there is a function called addaircraft it should be around line 375 Quote
Steve Bartlett Posted August 23, 2014 Author Report Posted August 23, 2014 Okay, here is what that section shows, in the core/common/operationsdata.class.php: * Add an aircraft * * $data = array( 'icao'=>$this->post->icao, * 'name'=>$this->post->name, * 'fullname'=>$this->post->fullname, * 'registration'=>$this->post->registration, * 'downloadlink'=>$this->post->downloadlink, * 'imagelink'=>$this->post->imagelink, * 'range'=>$this->post->range, * 'weight'=>$this->post->weight, * 'cruise'=>$this->post->cruise, * 'maxpax'=>$this->post->maxpax, * 'maxcargo'=>$this->post->maxcargo, * 'enabled'=>$this->post->enabled); */ public static function addAircraft($data) { /*$data = array('icao'=>$this->post->icao, 'name'=>$this->post->name, 'fullname'=>$this->post->fullname, 'registration'=>$this->post->registration, 'downloadlink'=>$this->post->downloadlink, 'imagelink'=>$this->post->imagelink, 'range'=>$this->post->range, 'weight'=>$this->post->weight, 'cruise'=>$this->post->cruise, 'maxpax'=>$this->post->maxpax, 'maxcargo'=>$this->post->maxcargo, 'enabled'=>$this->post->enabled);*/ $data['icao'] = DB::escape(strtoupper($data['icao'])); $data['name'] = DB::escape(strtoupper($data['name'])); $data['registration'] = DB::escape(strtoupper($data['registration'])); $data['range'] = ($data['range'] == '') ? 0 : $data['range']; $data['weight'] = ($data['weight'] == '') ? 0 : $data['weight']; $data['cruise'] = ($data['cruise'] == '') ? 0 : $data['cruise']; $data['range'] = str_replace(',', '', $data['range']); $data['weight'] = str_replace(',', '', $data['weight']); $data['cruise'] = str_replace(',', '', $data['cruise']); $data['maxpax'] = str_replace(',', '', $data['maxpax']); $data['maxcargo'] = str_replace(',', '', $data['maxcargo']); if ($data['enabled'] === true || $data['enabled'] == '1') $data['enabled'] = 1; else $data['enabled'] = 0; if ($data['minrank'] > 0) { $data['ranklevel'] = RanksData::getRankLevel($data['minrank']); } else { $data['ranklevel'] = '0'; } $cols = array(); $col_values = array(); foreach ($data as $key => $value) { $cols[] = "`{$key}`"; $value = DB::escape($value); $col_values[] = "'{$value}'"; } $cols = implode(', ', $cols); $col_values = implode(', ', $col_values); $sql = "INSERT INTO " . TABLE_PREFIX . "aircraft ({$cols}) VALUES ({$col_values})"; $res = DB::query($sql); if (DB::errno() != 0) return false; CodonCache::delete('all_aircraft'); CodonCache::delete('all_aircraft_enabled'); CodonCache::delete('all_aircraft_search'); CodonCache::delete('all_aircraft_search_enabled'); return true; Quote
Steve Bartlett Posted August 23, 2014 Author Report Posted August 23, 2014 Apparently there was something wrong in there I copied the operationsData.class.php from another VA I look after and pasted it into the one I am working on now. It is now working. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.