Re: [Galette-discussion] Contributions affichées tronquées (sans les centimes) ?

[ Thread Index | Date Index | More lists.galette.eu/users Archives ]


Bonjour,

Merci Guillaume !
(double) à la place de (int) affiche bien les bons montants dans les listes ou dans la contribution.

MAIS…
A l’enregistrement de la contribution (sans aucune modification), erreur de l’application.

Dans galette.log j’ai isolé les messages suivants :

2021-12-29 22:43:51 - DEBUG - Contribution checked successfully.
2021-12-29 22:43:53 - ERROR - Query error: UPDATE `galette_cotisations` SET `id_cotis` = '845', `id_adh` = '233', `id_type_cotis` = '1', `montant_cotis` = '20,55', `type_paiement_cotis` = '5', `info_cotis` = '', `date_enreg` = '2021-12-19', `date_debut_cotis` = '2021-12-19', `date_fin_cotis` = '2022-12-19' WHERE `id_cotis` = '845' PDOException: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'montant_cotis' at row 1 in /volume1/Galette/vendor/laminas/laminas-db/src/Adapter/Driver/Pdo/Connection.php:376
Stack trace:
#0 /volume1/Galette/vendor/laminas/laminas-db/src/Adapter/Driver/Pdo/Connection.php(376): PDO->query('UPDATE `galette...')
#1 /volume1/Galette/vendor/laminas/laminas-db/src/Adapter/Adapter..php(194): Laminas\Db\Adapter\Driver\Pdo\Connection->execute('UPDATE `galette...')
#2 /volume1/Galette/lib/Galette/Core/Db.php(788): Laminas\Db\Adapter\Adapter->query('UPDATE `galette...', 'execute')
#3 /volume1/Galette/lib/Galette/Entity/Contribution.php(675): Galette\Core\Db->execute(Object(Laminas\Db\Sql\Update))
#4 /volume1/Galette/lib/Galette/Controllers/Crud/ContributionsController.php(791): Galette\Entity\Contribution->store()


ET (désolé pour le stack trace kilométrique, je ne sais pas ce qui est pertinent ou pas )

2021-12-29 22:43:53 - ERROR - Galette error:
Type: PDOException
Code: 01000
Message: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'montant_cotis' at row 1
File: /volume1/Galette/vendor/laminas/laminas-db/src/Adapter/Driver/Pdo/Connection.php
Line: 376
Trace: #0 /volume1/Galette/vendor/laminas/laminas-db/src/Adapter/Driver/Pdo/Connection.php(376): PDO->query('UPDATE `galette...')
#1 /volume1/Galette/vendor/laminas/laminas-db/src/Adapter/Adapter.php(194): Laminas\Db\Adapter\Driver\Pdo\Connection->execute('UPDATE `galette...')
#2 /volume1/Galette/lib/Galette/Core/Db.php(788): Laminas\Db\Adapter\Adapter->query('UPDATE `galette...', 'execute')
#3 /volume1/Galette/lib/Galette/Entity/Contribution.php(675): Galette\Core\Db->execute(Object(Laminas\Db\Sql\Update))
#4 /volume1/Galette/lib/Galette/Controllers/Crud/ContributionsController.php(791): Galette\Entity\Contribution->store()
#5 /volume1/Galette/lib/Galette/Controllers/Crud/ContributionsController.php(728): Galette\Controllers\Crud\ContributionsController->store(Object(Slim\Http\Request), Object(Slim\Http\Response), 'edit', 'fee', 845)
#6 [internal function]: Galette\Controllers\Crud\ContributionsController->doEdit(Object(Slim\Http\Request), Object(Slim\Http\Response), 845, 'fee')
#7 /volume1/Galette/vendor/php-di/invoker/src/Invoker.php(74): call_user_func_array(Array, Array)
#8 /volume1/Galette/vendor/php-di/slim-bridge/src/ControllerInvoker.php(50): Invoker\Invoker->call(Array, Array)
#9 /volume1/Galette/vendor/slim/slim/Slim/Route.php(281): DI\Bridge\Slim\ControllerInvoker->__invoke(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#10 /volume1/Galette/lib/Galette/Middleware/Authenticate.php(173): Slim\Route->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
#11 [internal function]: Galette\Middleware\Authenticate->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
#12 /volume1/Galette/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Galette\Middleware\Authenticate), Array)
#13 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
#14 /volume1/Galette/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
#15 /volume1/Galette/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#16 /volume1/Galette/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
#17 /volume1/Galette/vendor/slim/slim/Slim/App.php(503): Slim\Route->run(Object(Slim\Http\Request), Object(Slim\Http\Response))
#18 /volume1/Galette/vendor/akrabat/rka-slim-session-middleware/RKA/SessionMiddleware.php(47): Slim\App->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
#19 [internal function]: RKA\SessionMiddleware->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Galette\Core\SlimApp))
#20 /volume1/Galette/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(RKA\SessionMiddleware), Array)
#21 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Galette\Core\SlimApp))
#22 /volume1/Galette/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Galette\Core\SlimApp))
#23 /volume1/Galette/lib/Galette/Middleware/SmartyCsrf.php(94): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#24 [internal function]: Galette\Middleware\SmartyCsrf->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#25 /volume1/Galette/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Galette\Middleware\SmartyCsrf), Array)
#26 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#27 /volume1/Galette/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#28 /volume1/Galette/vendor/slim/csrf/src/Guard.php(171): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#29 [internal function]: Slim\Csrf\Guard->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#30 /volume1/Galette/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Slim\Csrf\Guard), Array)
#31 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#32 /volume1/Galette/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#33 /volume1/Galette/lib/Galette/Middleware/TrailingSlash.php(81): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#34 [internal function]: Galette\Middleware\TrailingSlash->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#35 /volume1/Galette/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Galette\Middleware\TrailingSlash), Array)
#36 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#37 /volume1/Galette/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#38 /volume1/Galette/lib/Galette/Middleware/Language.php(104): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#39 [internal function]: Galette\Middleware\Language->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#40 /volume1/Galette/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Galette\Middleware\Language), Array)
#41 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#42 /volume1/Galette/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#43 /volume1/Galette/lib/Galette/Middleware/Telemetry.php(146): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#44 [internal function]: Galette\Middleware\Telemetry->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#45 /volume1/Galette/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Galette\Middleware\Telemetry), Array)
#46 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#47 /volume1/Galette/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#48 /volume1/Galette/lib/Galette/Middleware/CheckAcls.php(144): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#49 [internal function]: Galette\Middleware\CheckAcls->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#50 /volume1/Galette/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Galette\Middleware\CheckAcls), Array)
#51 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#52 /volume1/Galette/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#53 /volume1/Galette/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#54 /volume1/Galette/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
#55 /volume1/Galette/vendor/slim/slim/Slim/App.php(297): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response))
#56 /volume1/Galette/includes/main.inc.php(159): Slim\App->run()
#57 /volume1/Galette/webroot/index.php(57): require_once('/volume1/Galett....')
#58 {main}


Toute aide sera la bienvenue !

Cordialement
Thierry

Le 29 déc. 2021 à 21:19, Guillaume AGNIERAY <dev@xxxxxxxxxxxx> a écrit :

Le Wed, 29 Dec 2021 01:17:36 +0100
Thierry Marc <palijn@xxxxxxxx> a écrit :

Bonjour,

Bonjour,


J’ai toujours le même problème avec Galette à jour à 0.9.6.1 : les
contributions sont affichées sans les centimes. Ca me pose double
difficulté :
- certains adhérents paient quelques centimes en plus quand ils
choisissent un paiement en ligne (frais de traitement). Ca m’arrange
de voir du premier coup d’oeil la façon de payer grâce au montant.
- si j’ai le malheur de cliquer sur une contribution, lire le contenu
(commentaires éventuels) et sortir de là en cliquant sur «
Enregistrer »  … la contribution est mise à jour **sans les
centimes** en DB.  J’ai donc effectivement corrompu des données.

A priori c'est lié au changement de type ajouté dans cette modif :
https://bugs.galette.eu/projects/galette/repository/62/revisions/27d1f48f8820a51b10437380e22564ca64e9df2e/diff/galette/lib/Galette/Entity/Contribution.php

Remplacer (int) par (double) aux lignes 354 et 356 devrait rétablir
l'affichage des décimales.


Est-ce que je rapporte un bug ?
Merci pour vos lumières,

Oui c'est préférable.
La modif concerne à la base les tests unitaires.
Si ces variables ont été typées, il y a une raison.
Je ne sais pas si c'est une simple erreur de typage ou si ça aura
d'autres implications.
-- 

Guillaume

-- 
Galette users discussions

https://galette.eu - https://doc.galette..eu
http://bugs.galette.eu/projects/galette/

List documentation: https://listengine.tuxfamily.org/lists.galette.eu/users/



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/