The error is using $this->xxx into a static method. Good method is self::$xxx But xxx must also be declared as static and you can't have both a property xxx for static return and another with same name for instanciated returns.
For the pointed bug, i pushed a fix into git 3.3 branch. Le 07/01/2013 15:02, Florian Henry a écrit : > Happy new year every body ! > > In class /htdocs/comm/action/actioncomm.class.php, i found > something that I don't know how to solve. > > In Branch 3.3 and Dev (may be older, I didn't check), the static > method getActions (line 546) we have that > $this->error=$db->lasterror(); (line 584) if the SQL is bad. This is a > normal SQL error statement, but as the method is static I got this error. > > Fatal error: Using $this when not in object context in > /home/bobby/Eclipse/workspace/dolibarr/htdocs/comm/action/class/actioncomm.class.php > on line 584 > > I know where is the error, it's in my SQL filter statement, but > this mail is more to ask "What is the correct way in dolibarr to > affect error on this non-object in static method?" > > I call it into pages with this instruction : > ActionComm::getActions($db,$user->societe_id,0,'','bala'); > > Kind regards > -- Eldy (Laurent Destailleur). EMail: [email protected] Web: http://www.destailleur.fr Dolibarr (Project leader): http://www.dolibarr.org To make a donation for Dolibarr project via Paypal: [email protected] AWStats (Author) : http://awstats.sourceforge.net To make a donation for AWStats project via Paypal: [email protected] AWBot (Author) : http://awbot.sourceforge.net CVSChangeLogBuilder (Author) : http://cvschangelogb.sourceforge.net _______________________________________________ Dolibarr-dev mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
