Bug - Order (commande) clone

I’ve found a bug in 3.6.0 release. I’ve downloaded latest 3.6.1 release and there’s the same error.
Please have a look at commande/classs/commande.class.php -> method: createFromClone($socid=0)…
There’s no code to add next ref to the order so it’s not able to clone orders.
Missing code:

    // Set ref
    require_once DOL_DOCUMENT_ROOT ."/core/modules/commande/".$conf-\>global-\>COMMANDE_ADDON.'.php';
    $obj = $conf-\>global-\>COMMANDE_ADDON;
    $modCommande = new $obj;
    $this-\>ref = $modCommande-\>getNextValue($objsoc,$this);

Ya, it was reported in [url=www.dolibarr.org/t/3-6-0-error-when-trying-to-clone-an-order/11196/1 post[/url]

Because I ran in a slightly similar problem during test of 3.8.0:

Pls. be reluctant to use “hidden features” found somewhere in source-code in Other Setup!

My “self-inflicted wounds” (empty PDF of cloned order) stemmed from the fact that I’d tried out different additions to Other Setup recently:

MAIN_GENERATE_DOCUMENTS_HIDE_DESC
MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS
MAIN_GENERATE_DOCUMENTS_HIDE_REF

Be aware that using / or changing Other Setup values does indeed affect clones of documents already created with Older Setup settings!

Best regards