CFVA Posted January 8, 2018 Report Posted January 8, 2018 (edited) Install this module (php verion for PHPVMS 5.5.2) and get this error when selecting an aircraft, and the following screen http://....../fleet/view/(any aircraft) gives this error: Deprecated: Non-static method FleetData::getAircraftTotals() should not be called statically, assuming $this from incompatible context in /home/www/lakervirtual.com/core/modules/Fleet/Fleet.php on line 36Deprecated: Non-static method FleetData::get5MostRecentFlights() should not be called statically, assuming $this from incompatible context in /home/www/lakervirtual.com/core/modules/Fleet/Fleet.php on line 37Deprecated: Non-static method FleetData::getAllScheduledFlights() should not be called statically, assuming $this from incompatible context in /home/www/lakervirtual.com/core/modules/Fleet/Fleet.php on line 38 after those messages rest of page displays OK. Any ideas anyone?? Thanks Edited January 13, 2018 by LakerVirtual SOLVED Quote
Moderators mark1million Posted January 8, 2018 Moderators Report Posted January 8, 2018 you need to update the files to public static function from public function. Quote
CFVA Posted January 8, 2018 Author Report Posted January 8, 2018 How, please. I;m no php expert Quote
CFVA Posted January 10, 2018 Author Report Posted January 10, 2018 Anyone please?? What does this answer mean? Quote
Moderators shakamonkey88 Posted January 10, 2018 Moderators Report Posted January 10, 2018 Literally as mark1million said. Open up fleet.php (located in core/modules/fleet) and change every "public static function" to "public function" Quote
CFVA Posted January 11, 2018 Author Report Posted January 11, 2018 I've done that and still got same error messages. Here is fleet.php <?php /** * phpVMS - Virtual Airline Administration Software * Copyright (c) 2008 Nabeel Shahzad * For more information, visit www.phpvms.net * Forums: http://www.phpvms.net/forum * Documentation: http://www.phpvms.net/docs * * phpVMS is licenced under the following license: * Creative Commons Attribution Non-commercial Share Alike (by-nc-sa) * View license.txt in the root, or visit http://creativecommons.org/licenses/by-nc-sa/3.0/ * * @author Nabeel Shahzad * @copyright Copyright (c) 2008, Nabeel Shahzad * @link http://www.phpvms.net * @license http://creativecommons.org/licenses/by-nc-sa/3.0/ */ class Fleet extends CodonModule { public function index() { $this->set('aircrafts', FleetData::GetAllAircrafts()); $this->show('fleet/fleet_list'); } public function view($aircraftid) { $this->set('basicinfo', FleetData::getBasicInfo($aircraftid)); $this->set('purchasedate', FleetData::getDateOfPurchase($aircraftid)); $this->set('firstflight', FleetData::getFirstFlight($aircraftid)); $this->set('lastflight', FleetData::getLastFlight($aircraftid)); $this->set('detailedinfo', FleetData::getAircraftTotals($aircraftid)); $this->set('recentflights', FleetData::get5MostRecentFlights($aircraftid)); $this->set('scheduledflights', FleetData::getAllScheduledFlights($aircraftid)); $this->show('fleet/fleet_view'); } } Quote
Moderators shakamonkey88 Posted January 11, 2018 Moderators Report Posted January 11, 2018 What PHP version are you using? Who is your hoster? Quote
CFVA Posted January 11, 2018 Author Report Posted January 11, 2018 (edited) 1 hour ago, shakamonkey88 said: What PHP version are you using? Who is your hoster? PHP 5.6 tried with PHP 5.5 also, & freehostia.com Edited January 11, 2018 by LakerVirtual Quote
Moderators servetas Posted January 13, 2018 Moderators Report Posted January 13, 2018 Open your core/common/FleetData.class.php file and replace where: public function with: public static function Quote
CFVA Posted January 13, 2018 Author Report Posted January 13, 2018 22 minutes ago, servetas said: Open your core/common/FleetData.class.php file and replace where: public function with: public static function there is only 'public static' not 'public function' Part of FleetData.class.php: <?php // -- Class Name : FleetData // -- Purpose : Gathers Detailed Information on VA Aircrafts // -- Created On : 10/27/2013 // -- Last Revised On : 10/27/2013 // -- Version : 1.0 class FleetData extends CodonData { public static // -- Function Name : GetAllAircrafts // -- Params : // -- Purpose : function GetAllAircrafts() { $sql = 'SELECT * FROM '.TABLE_PREFIX.'aircraft WHERE `enabled` = 1'; return DB::get_results($sql); } public static // -- Function Name : getBasicInfo // -- Params : $id // -- Purpose : function getBasicInfo($id) Quote
Moderators servetas Posted January 13, 2018 Moderators Report Posted January 13, 2018 I feel that the file is messed up. Can you attach the file so we can preview it using a code editor? Quote
CFVA Posted January 13, 2018 Author Report Posted January 13, 2018 17 minutes ago, servetas said: I feel that the file is messed up. Can you attach the file so we can preview it using a code editor? Attached FleetData.class.zip Quote
CFVA Posted January 13, 2018 Author Report Posted January 13, 2018 I have deleted & re-installed all the files for this module and now it seems to work!! Not sure of why, but there you go. Thanks for all your help guys. 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.