Bug - page blanche après validation facture

Bonjour,

Dolibarr v17.0.1 avec php 8.1.

J’obtiens une page blanche après validation d’une facture client (et après test, seulement pour ce client). Voici les logs du serveur Apache juste après l’anomalie :

monsite.ch [Tue May 02 18:16:00.615245 2023] [-:error] [pid 235838:tid 140432671500032] [client 112.192.223.114:0]
FastCGI: server "/home/clients/14c72937ac6d7c57208624c6c2a2b2b5/.config/apache/monsite.ch/.fpm/php5.external"
stderr: PHP message: PHP Warning:  Undefined property: Conf::$multicurrency in /home/clients/14c72937ac6d7c57208624c6c2a2b2b5/web/erp-cm/core/modules/facture/doc/pdf_monsite.modules.php on line 283
PHP message: PHP Warning:  Attempt to read property "enabled" on null in /home/clients/14c72937ac6d7c57208624c6c2a2b2b5/web/erp-cm/core/modules/facture/doc/pdf_monsite.modules.php on line 283
PHP message: PHP Warning:  Undefined property: Conf::$multicurrency in /home/clients/14c72937ac6d7c57208624c6c2a2b2b5/web/erp-cm/core/modules/facture/doc/pdf_monsite.modules.php on line 284
PHP message: PHP Warning:  Attempt to read property "enabled" on null in /home/clients/14c72937ac6d7c57208624c6c2a2b2b5/web/erp-cm/core/modules/facture/doc/pdf_monsite.modules.php on line 284
PHP message: PHP Warning:  Undefined property: Conf::$multicurrency in /home/clients/14c72937ac6d7c57208624c6c2a2b2b5/web/erp-cm/core/modules/facture/doc/pdf_monsite.modules.php on line 285
PHP message: PHP Warning:  Attempt to read property "enabled" on null, referer https://www.monsite.ch/erp-cm/compta/facture/card.php?facid=8371&action=valid&token=65afae2b5d327efc87502433e56d438f
monsite.ch [Tue May 02 18:16:00.615266 2023] [-:warn] [pid 235838:tid 140432671500032] [client 112.192.223.114:0]
FastCGI: too much stderr received from server "/home/clients/14c72937ac6d7c57208624c6c2a2b2b5/.config/apache/monsite.ch/.fpm/php5.external", increase FCGI_SERVER_MAX_STDERR_LINE_LEN (1023) and rebuild or use "\\n" to terminate lines, referer https://www.monsite.ch/erp-cm/compta/facture/card.php?facid=8371&action=valid&token=65afae2b5d327efc87502433e56d438f
monsite.ch

[Tue May 02 18:16:00.615271 2023] [-:error] [pid 235838:tid 140432671500032] [client 112.192.223.114:0] FastCGI: server "/home/clients/14c72937ac6d7c57208624c6c2a2b2b5/.config/apache/monsite.ch/.fpm/php5.external" stderr:  in /home/clients/14c72937ac6d7c57208624c6c2a2b2b5/web/erp-cm/core/modules/facture/doc/pdf_monsite.modules.php on line 285
PHP message: PHP Warning:  Undefined property: Conf::$incoterm in /home/clients/14c72937ac6d7c57208624c6c2a2b2b5/web/erp-cm/core/modules/facture/doc/pdf_monsite.modules.php on line 411
PHP message: PHP Warning:  Attempt to read property "enabled" on null in /home/clients/14c72937ac6d7c57208624c6c2a2b2b5/web/erp-cm/core/modules/facture/doc/pdf_monsite.modules.php on line 411
PHP message: PHP Fatal error:  Uncaught TypeError: number_format(): Argument #1 ($num) must be of type float, string given in /home/clients/14c72937ac6d7c57208624c6c2a2b2b5/web/erp-cm/core/modules/facture/doc/pdf_monsite.modules.php:593, referer https://www.monsite.ch/erp-cm/compta/facture/card.php?facid=8371&action=valid&token=65afae2b5d327efc87502433e56d438f monsite.ch

[Tue May 02 18:16:00.615275 2023] [-:error] [pid 235838:tid 140432671500032] [client 112.192.223.114:0] FastCGI: server "/home/clients/14c72937ac6d7c57208624c6c2a2b2b5/.config/apache/monsite.ch/.fpm/php5.external" stderr: Stack trace:, referer https://www.monsite.ch/erp-cm/compta/facture/card.php?facid=8371&action=valid&token=65afae2b5d327efc87502433e56d438f monsite.ch

[Tue May 02 18:16:00.615278 2023] [-:error] [pid 235838:tid 140432671500032] [client 112.192.223.114:0] FastCGI: server "/home/clients/14c72937ac6d7c57208624c6c2a2b2b5/.config/apache/monsite.ch/.fpm/php5.external" stderr: #0 /home/clients/14c72937ac6d7c57208624c6c2a2b2b5/web/erp-cm/core/modules/facture/doc/pdf_monsite.modules.php(593): number_format('1 250.00', '2', '.', ','), referer https://www.monsite.ch/erp-cm/compta/facture/card.php?facid=8371&action=valid&token=65afae2b5d327efc87502433e56d438f monsite.ch

[Tue May 02 18:16:00.615281 2023] [-:error] [pid 235838:tid 140432671500032] [client 112.192.223.114:0] FastCGI: server "/home/clients/14c72937ac6d7c57208624c6c2a2b2b5/.config/apache/monsite.ch/.fpm/php5.external" stderr: #1 /home/clients/14c72937ac6d7c57208624c6c2a2b2b5/web/erp-cm/core/class/commonobject.class.php(5538): pdf_monsite->write_file(Object(Facture), Object(Translate), '', 0, 0, 1, NULL), referer https://www.monsite.ch/erp-cm/compta/facture/card.php?facid=8371&action=valid&token=65afae2b5d327efc87502433e56d438f monsite.ch

[Tue May 02 18:16:00.615284 2023] [-:error] [pid 235838:tid 140432671500032] [client 112.192.223.114:0] FastCGI: server "/home/clients/14c72937ac6d7c57208624c6c2a2b2b5/.config/apache/monsite.ch/.fpm/php5.external" stderr: #2 /home/clients/14c72937ac6d7c57208624c6c2a2b2b5/web/erp-cm/compta/facture/class/facture.class.php(5043): CommonObject->commonGenerateDocument('core/modules/fa...', 'monsite', Object(Translate), 0, 0, 1, NULL), referer https://www.monsite.ch/erp-cm/compta/facture/card.php?facid=8371&action=valid&token=65afae2b5d327efc87502433e56d438f monsite.ch

[Tue May 02 18:16:00.615286 2023] [-:error] [pid 235838:tid 140432671500032] [client 112.192.223.114:0] FastCGI: server "/home/clients/14c72937ac6d7c57208624c6c2a2b2b5/.config/apache/monsite.ch/.fpm/php5.external" stderr: #3 /home/clients/14c72937ac6d7c57208624c6c2a2b2b5/web/erp-cm/compta/facture/card.php(683): Facture->generateDocument('monsite', Object(Translate), 0, 0, 1), referer https://www.monsite.ch/erp-cm/compta/facture/card.php?facid=8371&action=valid&token=65afae2b5d327efc87502433e56d438f monsite.ch

[Tue May 02 18:16:00.615289 2023] [-:error] [pid 235838:tid 140432671500032] [client 112.192.223.114:0] FastCGI: server "/home/clients/14c72937ac6d7c57208624c6c2a2b2b5/.config/apache/monsite.ch/.fpm/php5.external" stderr: #4 {main}, referer https://www.monsite.ch/erp-cm/compta/facture/card.php?facid=8371&action=valid&token=65afae2b5d327efc87502433e56d438f
monsite.ch [Tue May 02 18:16:00.615458 2023] [fastcgi:error] [pid 235838:tid 140432671500032] [client 112.192.223.114:0] FastCGI: server "/home/clients/14c72937ac6d7c57208624c6c2a2b2b5/.config/apache/monsite.ch/.fpm/php5.external" stderr:   thrown in /home/clients/14c72937ac6d7c57...b2b5/web/erp-cm/core/class/commonobject.class.php(5538): pdf_monsite->write_file(Object(Facture), Object(Translate), '', 0, 0, 1, NULL), referer https://www.monsite.ch/erp-cm/compta/facture/card.php?facid=8371&action=valid&token=65afae2b5d327efc87502433e56d438f

On y lit plusieurs types d’erreur. Je n’ai pas assez de connaissance pour y voir clair mais je peux fournir d’autres informations si nécessaires.

Merci

Bonsoir,

Vous avez un modele de pdf spécifique a priori.

Même problème quand vous vous rendez dans l’administration du module facture ?

C’est correct, j’ai personnalisé la facture à partir du modèle crabe. La génération du pdf à partir de crabe fonctionne alors que ce n’est pas le cas avec mon modèle personnalisé (mais ça marchait avec la version 16.0.4).

C’est à dire ? Je n’ai pas très bien compris la question, désolé.

Bonsoir,

A priori la fonction number_format() a évolué avec la v17. Le modèle crabe a du être mis à jour lui aussi pour pouvoir fonctionner. Pour commencer tu peux rechercher cette fonction dans ton modèle ainsi que dans le modèle crabe pour comparer les 2 syntaxes.
Je n’ai pas de v17 sous la main pour comparer avec le modèle que j’ai fait pour moi…

Bonjour,

Il ne faut pas chercher plus loin, il faut refaire votre modèle personnalisé pour la v17.0.x. C’est courant que ce soit fonctionnel d’une version à l’autre mais en ce moment avec les évolutions pour Php8, les factures électroniques, la sécurisation, etc… On est sur gros changement du code donc il faut refaire. Après comme le dit AGI, c’est peut juste une fonction manquante dans votre modèle donc à voir

Pour mon autre question, c’était de savoir si vous aviez une autre page blanche en allant dans Accueil > Configuration > Modules > Factures.

Bonne journée

Bonjour,

Merci pour vos réponses qui me mettent sur la bonne voie. Je vais corriger mon modèle et voir si ça passe.

b.

Bonjour,

ne partez pas de « crabe » mais utilisez « sponge » qui sera la nouvelle version par defaut

Bonsoir,
Merci pour les infos ! Je lui suggérais crabe car il fonctionnait et que comme c’était son modèle de départ ça lui permettait d’avoir en théorie 2 fichiers relativement proches.

C’est bien noté, merci pour le conseil !

Et très belle journée.