THELIA Forum

Welcome to the THELIA support and discusssion forum

Announcement

Rejoignez la communauté sur le Discord Thelia : https://discord.gg/YgwpYEE3y3

Offline


Bonjour,

J'essaie bien de me débrouiller par mes propres moyens au maximum et de vous embeter le moins possible ..

J'ai quelques modules de livraisons et un module de payment (klikandpay) qui ne sont plus utilisés.
J'aimerais mieux les virer avant maj car ils ne sont plus maintenus ou ont été mal codés/modifiés (par moi même).
Et du coup, je n'arrive pas à mettre à jour pour le moment sur mon environnement de dev.

Je sais, je n'aurais jamais du installer ces trucs en prod mais parfois on fait ce qu'on peut dans l'urgence.

Bref, afin de modifier le numéro du module lié aux commandes et pouvoir les virer, je viens d'essayer de faire des choses de ce type dans la base :

 UPDATE `order` SET delivery_module_id = '136' WHERE `delivery_module_id` = '80'  

Sur le moment, la commande sql fait le taf, mais si je tente d'installer un nouveau module, à l'activation je reçois :

 Cannot insert a value for auto-increment primary key (colissimo_home_delivery_freeshipping.id) 

Comment je peux m'en sortir ?

Last edited by vz777 (15-01-2023 12:00:36)

Offline


Bon j'ai fini par essayer d'installer un autre module et ça marche, donc je pense qu'il y a un souci avec le colissimo home delivery, ou bien que ce module a un probleme avec moi.

J'ai donc pu virer mes modules obsolètes et j'ai pu avancer dans ma tentative de maj.
J'arrive à me connecter à mon bo, youpi ! Je suis bien content.

Par contre, en front,
j'ai :

Attempted to load class "Stripe" from namespace "Stripe".
Did you forget a "use" statement for another namespace?

Ah, oui c'est vrai stripe ..

Bon ben go

$ composer update thelia/stripe-payment-module

Le terminal m'envoi boulé avec :

  Problem 1
    - symfony/framework-bundle v6.2.3 requires composer-runtime-api >=2.1 -> found composer-runtime-api[2.0.0] but it does not match the constraint.
    - thelia/thelia-skeleton 2.5.2 requires thelia/core 2.5.2 -> satisfiable by thelia/core[2.5.2].
    - thelia/core 2.5.2 requires symfony/framework-bundle 6.0.*|6.2.* -> satisfiable by symfony/framework-bundle[v6.2.3].
    - thelia/thelia-skeleton is locked to version 2.5.2 and an update of this package was not requested.

Cette fois je suis coincé

Last edited by vz777 (15-01-2023 17:18:43)

Offline


Tu peux forcer une dependance : genre composer require composer-runtime-api:"2.1.*"


OpenStudio Toulouse

Offline


ok merci je vais voir ça

autre chose, je n'arrive qu'a faire tourner en php 8.1,
en 8.2, je reçois :

Unable to open connection

Propel\Runtime\Connection\Exception\ConnectionException:
Unable to open connection

  at /home/../../../vendor/thelia/propel/src/Propel/Runtime/Connection/ConnectionFactory.php:45
  at Propel\Runtime\Connection\ConnectionFactory::create()
     (/home/../../../vendor/thelia/propel/src/Propel/Runtime/Connection/ConnectionManagerSingle.php:96)
  at Propel\Runtime\Connection\ConnectionManagerSingle->getWriteConnection()
     (/home/../../../vendor/thelia/propel/src/Propel/Runtime/ServiceContainer/StandardServiceContainer.php:427)
  at Propel\Runtime\ServiceContainer\StandardServiceContainer->getWriteConnection()
     (/home/../../../vendor/thelia/propel/src/Propel/Runtime/ServiceContainer/StandardServiceContainer.php:411)
  at Propel\Runtime\ServiceContainer\StandardServiceContainer->getConnection()
     (/home/../../../vendor/thelia/propel/src/Propel/Runtime/Propel.php:226)
  at Propel\Runtime\Propel::getConnection()
     (/home/../../../vendor/thelia/core/lib/Thelia/Core/PropelInitService.php:412)
  at Thelia\Core\PropelInitService->init()
     (/home/../../../vendor/thelia/core/lib/Thelia/Core/Thelia.php:338)
  at Thelia\Core\Thelia->initializePropelService()
     (/home/../../../vendor/thelia/core/lib/Thelia/Core/Thelia.php:268)
  at Thelia\Core\Thelia->initializeContainer()
     (/home/../../../vendor/thelia/core/lib/Thelia/Core/Thelia.php:408)
  at Thelia\Core\Thelia->preBoot()
     (/home/../../../vendor/thelia/core/lib/Thelia/Core/Thelia.php:429)
  at Thelia\Core\Thelia->handle()
     (/home/../../../web/index_dev.php:43)          

Est ce qu'il y a des extensions php à activer en plus ou autre chose à faire ?

Offline


"Unable to open connection" => la connexion a la BDD echoue, vérifie les paramètres de connexion dans le fichier .env.local


OpenStudio Toulouse

Offline


Pour ce qui est de composer, je me suis aperçu que ça venait d'un problème de version de composer.
J'ai évidemment chercher à raccourcir php composer.phar en composer, ce qui semble faire revenir composer à une version antèrieure.
Pas grave, je vais travailler avec composer.phar

Faut juste que j'apprene à lui demander des versions main, si on fait pas gaffe c'est la version master qui s'amène ..


Pour ce qui est de mon histoire avec php 8.2 et unable to open connection,
le truc c'est que php 8.1 arrive bien à ouvrir la connection

Offline


Bon je me suis repenché sur le cas stripe.
Je ne sais pas si c'est ce qu'il fallait faire ?

Mais voila ce que j'ai fait:

php composer.phar require stripe/stripe-php:"7.*"
php composer.phar require thelia/stripe-payment-module dev-main

Le module s'affiche pas de pb.

Quand je vais pour payer une commande sur order/invoice puis next step, en direction de order/pay,
je rencontre une erreur

Voila ce que j'ai dans les logs

Uncaught PHP Exception Symfony\Component\ErrorHandler\Error\UndefinedMethodError: "Attempted to call an undefined method named "create" of class "Thelia\Core\HttpFoundation\Response"." at /../../../../local/modules/StripePayment/StripePayment.php line 361

Et la stack trace :

Symfony\Component\ErrorHandler\Error\UndefinedMethodError:
Attempted to call an undefined method named "create" of class "Thelia\Core\HttpFoundation\Response".

  at local/modules/StripePayment/StripePayment.php:361
  at StripePayment\StripePayment->createStripeSession()
     (local/modules/StripePayment/StripePayment.php:181)
  at StripePayment\StripePayment->doPay()
     (local/modules/StripePayment/StripePayment.php:158)
  at StripePayment\StripePayment->pay()
     (vendor/thelia/core/lib/Thelia/Action/Module.php:401)
  at Thelia\Action\Module->pay()
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:115)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:206)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:56)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:127)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
     (vendor/thelia/core/lib/Thelia/Action/Order.php:419)
  at Thelia\Action\Order->create()
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:115)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:206)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:56)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:127)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
     (local/modules/Front/Controller/OrderController.php:325)
  at Front\Controller\OrderController->pay()
     (vendor/symfony/http-kernel/HttpKernel.php:163)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:74)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/thelia/core/lib/Thelia/Core/TheliaHttpKernel.php:72)
  at Thelia\Core\TheliaHttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:184)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/thelia/core/lib/Thelia/Core/Thelia.php:438)
  at Thelia\Core\Thelia->handle()
     (web/index_dev.php:43)                

Il y a un autre souci quand je rentre l'url du webhook dans le navigateur :

https://domaine.tld/module/StripePaymen … ook/listen
Je reçois :

Warning: Undefined array key "HTTP_STRIPE_SIGNATURE"

Last edited by vz777 (21-01-2023 09:52:10)

Offline


Bon alors je revient sur l'histoire avec php 8.2,
cela fonctionne à présent donc JOIE !

J'ai été emm.. mon hébergeur qui m'a dit de désactiver :
mysqli

et d'activer :
mysqlnd, nd_mysqli et nd_pdo_mysql

Au départ, ils m'ont dit
Il semblerait que les fonctionnalités de connexion pdo_mysql ne soient pas compatibles avec votre application. 

Leur explication :
Cela fait suite à une mise à jour de MariaDB datant d'il y a un mois.
Les fonctionnalités mysqli sont remplacées par nd_.


Peut être qu'il faut en parler sur git ou dans la doc.