Le 04/09/2013 07:32, Sébastien a écrit :
> function __clone()
>     {
>         // Force a copy of this->lines, otherwise it will point to
> same object.
>         for($i=0; $i < count($this->lines); $i++){
>             $this->lines[$i] = clone $this->lines[$i];
>         }
>     }

So we should have this __clone function for all objects that has ->lines
array.
I tried to add into the commonobject.class.php

    function __clone()
    {
        // Force a copy of this->lines, otherwise it will point to same
object.
        if (isset($this->lines) && is_array($this->lines))
        {
            for($i=0; $i < count($this->lines); $i++)
            {
                $this->lines[$i] = dol_clone($this->lines[$i]);
            }
        }
    }

Is it ok for you ?

-- 
Eldy (Laurent Destailleur).

EMail: e...@destailleur.fr
Web: http://www.destailleur.fr

Dolibarr (Project leader): http://www.dolibarr.org
To make a donation for Dolibarr project via Paypal: cont...@destailleur.fr
AWStats (Author) : http://awstats.sourceforge.net
To make a donation for AWStats project via Paypal: cont...@destailleur.fr
AWBot (Author) : http://awbot.sourceforge.net
CVSChangeLogBuilder (Author) : http://cvschangelogb.sourceforge.net


_______________________________________________
Dolibarr-dev mailing list
Dolibarr-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev

Répondre à