shacker Posted February 13, 2017 Share Posted February 13, 2017 Hi. I try to update a module from PS 1.6 to 1.7. I added the use PrestaShop\PrestaShop\Core\Payment\PaymentOption; and use this code (jsut to simplify) public function hookPaymentOptions() { $newOption = new PaymentOption(); $paymentForm = $this->fetch('module:mymod/views/templates/hook/payment.tpl'); $newOption->setCallToActionText($this->trans('Pay by MyModule', array(), 'Modules.MyMod')); return [$newOption]; } and i get that the error This doesn't seem to be a class name logger Anybody have a clue? Link to comment Share on other sites More sharing options...
rocky Posted February 13, 2017 Share Posted February 13, 2017 I found the code that generates that error on line 96 of src\Core\Foundation\IoC\Container.php: try { $refl = new \ReflectionClass($className); } catch (\ReflectionException $re) { throw new Exception(sprintf('This doesn\'t seem to be a class name: `%s`.', $className)); } It seems to be trying to instantiate the "logger" class, but it can't find it. I'm not sure why. I can see two Logger classes, one in vendor\monolog\monolog\src\Monolog\Logger.php and vendor\symfony\symfony\src\Symfony\Bridge\Monolog\Logger.php. I guess one of those needs to be included. Link to comment Share on other sites More sharing options...
ventura Posted February 13, 2017 Share Posted February 13, 2017 Do you add this in the public function __construct() $this->page = basename(__FILE__, '.php'); ? and maybe add the params in public function hookPaymentOptions($params) Link to comment Share on other sites More sharing options...
shacker Posted February 13, 2017 Author Share Posted February 13, 2017 thanks to both, i try and back. but is strange,m in the chequemodule that class is not included Link to comment Share on other sites More sharing options...
shacker Posted February 13, 2017 Author Share Posted February 13, 2017 Do you add this in the public function __construct() $this->page = basename(__FILE__, '.php'); ? and maybe add the params in public function hookPaymentOptions($params) already set that and same results: full log in Container.php line 96 at Container->makeInstanceFromClassName('logger', array('logger' => true)) in Container.php line 158 at Container->doMake('logger', array()) in Container.php line 171 at Container->make('logger') in ServiceLocator.php line 55 at ServiceLocator::get('logger') in HookManager.php line 68 at HookManager->exec('paymentOptions', array(), null, true) in HookFinder.php line 70 at HookFinder->find() in PaymentOptionsFinder.php line 59 at PaymentOptionsFinderCore->find() in PaymentOptionsFinder.php line 95 at PaymentOptionsFinderCore->present() in CheckoutPaymentStep.php line 75 at CheckoutPaymentStepCore->render(array('identifier' => 'checkout-payment-step', 'position' => '4', 'ui' => object(RenderableProxy))) in RenderableProxy.php line 52 at RenderableProxy->render(array('identifier' => 'checkout-payment-step', 'position' => '4', 'ui' => object(RenderableProxy))) in smartyfront.config.inc.php line 94 at smartyRender(array('identifier' => 'checkout-payment-step', 'position' => '4', 'ui' => object(RenderableProxy)), object(Smarty_Dev_Template)) at call_user_func_array('smartyRender', array(array('identifier' => 'checkout-payment-step', 'position' => '4', 'ui' => object(RenderableProxy)), object(Smarty_Dev_Template))) in SmartyLazyRegister.php line 83 at SmartyLazyRegister->__call('smartyRender', array(array('identifier' => 'checkout-payment-step', 'position' => '4', 'ui' => object(RenderableProxy)), object(Smarty_Dev_Template))) in smarty_internal_templatebase.php(157) : eval()'d code line 36 at SmartyLazyRegister->smartyRender(array('identifier' => 'checkout-payment-step', 'position' => '4', 'ui' => object(RenderableProxy)), object(Smarty_Dev_Template)) in smarty_internal_templatebase.php(157) : eval()'d code line 36 at content_58a1d2f3df1031_29484816(object(Smarty_Dev_Template)) in smarty_internal_templatebase.php line 188 at Smarty_Internal_TemplateBase->fetch(null, null, null, null, false, true, false) in SmartyDev.php line 60 at Smarty_Dev_Template->fetch() in CheckoutProcess.php line 110 at CheckoutProcessCore->render(array('file' => 'checkout/checkout-process.tpl', 'ui' => object(RenderableProxy))) in RenderableProxy.php line 52 at RenderableProxy->render(array('file' => 'checkout/checkout-process.tpl', 'ui' => object(RenderableProxy))) in smartyfront.config.inc.php line 94 at smartyRender(array('file' => 'checkout/checkout-process.tpl', 'ui' => object(RenderableProxy)), object(Smarty_Dev_Template)) at call_user_func_array('smartyRender', array(array('file' => 'checkout/checkout-process.tpl', 'ui' => object(RenderableProxy)), object(Smarty_Dev_Template))) in SmartyLazyRegister.php line 83 at SmartyLazyRegister->__call('smartyRender', array(array('file' => 'checkout/checkout-process.tpl', 'ui' => object(RenderableProxy)), object(Smarty_Dev_Template))) in smarty_internal_templatebase.php(157) : eval()'d code line 140 at SmartyLazyRegister->smartyRender(array('file' => 'checkout/checkout-process.tpl', 'ui' => object(RenderableProxy)), object(Smarty_Dev_Template)) in smarty_internal_templatebase.php(157) : eval()'d code line 140 at content_58a1d2f36c1102_63778738(object(Smarty_Dev_Template)) in smarty_internal_templatebase.php line 188 at Smarty_Internal_TemplateBase->fetch('checkout/checkout.tpl', null, 'layouts/layout-full-width.tpl', null, false, true, false) in SmartyDev.php line 41 at SmartyDev->fetch('checkout/checkout.tpl', null, 'layouts/layout-full-width.tpl') in FrontController.php line 655 at FrontControllerCore->smartyOutputContent('checkout/checkout.tpl') in FrontController.php line 639 at FrontControllerCore->display() in Controller.php line 221 at ControllerCore->run() in Dispatcher.php line 366 at DispatcherCore->dispatch() in index.php line 28 Link to comment Share on other sites More sharing options...
webbax Posted February 21, 2017 Share Posted February 21, 2017 Hello, On my side I am also migrating the payment modules, I have the same error. As soon as you try to make a "->fetch (..." the error occurs. Link to comment Share on other sites More sharing options...
shacker Posted February 21, 2017 Author Share Posted February 21, 2017 no luck yet Link to comment Share on other sites More sharing options...
webbax Posted February 22, 2017 Share Posted February 22, 2017 You can try to put in the "payment.tpl" file a text ex. 1234 and remove all the rest of the code? This seems to have worked for me with the "payment_infos.tpl" file. Link to comment Share on other sites More sharing options...
mister_j Posted February 28, 2017 Share Posted February 28, 2017 You have to update logger location. in src/Adapter/HookManager.php Replace this $logger = \PrestaShop\PrestaShop\Adapter\ServiceLocator::get('logger'); with this $logger = \PrestaShop\PrestaShop\Adapter\ServiceLocator::get('\\PrestaShop\\PrestaShop\\Adapter\\LegacyLogger'); Github link https://github.com/PrestaShop/PrestaShop/commit/3371fd34d94791c962c305d0e1e423068b84cb2a Link to comment Share on other sites More sharing options...
shacker Posted February 28, 2017 Author Share Posted February 28, 2017 ok, thats correct, but now i have no payment options (cheque or any other) Link to comment Share on other sites More sharing options...
webbax Posted March 1, 2017 Share Posted March 1, 2017 Remove the code from the TPL files of the modules to test. 1 Link to comment Share on other sites More sharing options...
shacker Posted March 1, 2017 Author Share Posted March 1, 2017 Remove the code from the TPL files of the modules to test. already did this solve the issue You have to update logger location. in src/Adapter/HookManager.php Replace this $logger = \PrestaShop\PrestaShop\Adapter\ServiceLocator::get('logger'); with this $logger = \PrestaShop\PrestaShop\Adapter\ServiceLocator::get('\\PrestaShop\\PrestaShop\\Adapter\\LegacyLogger'); Github link but now i have no payment methods, must check more Link to comment Share on other sites More sharing options...
webbax Posted March 7, 2017 Share Posted March 7, 2017 Hello, In the Payment options hook method you must have this: $this->smarty->assign( $this->getTemplateVars() ); Try replacing by $this->context->smarty->assign( $this->getTemplateVars() ); Link to comment Share on other sites More sharing options...
presto07 Posted March 29, 2017 Share Posted March 29, 2017 already set that and same results: full log in Container.php line 96 at Container->makeInstanceFromClassName('logger', array('logger' => true)) in Container.php line 158 at Container->doMake('logger', array()) in Container.php line 171 at Container->make('logger') in ServiceLocator.php line 55 at ServiceLocator::get('logger') in HookManager.php line 68 at HookManager->exec('paymentOptions', array(), null, true) in HookFinder.php line 70 at HookFinder->find() in PaymentOptionsFinder.php line 59 at PaymentOptionsFinderCore->find() in PaymentOptionsFinder.php line 95 at PaymentOptionsFinderCore->present() in CheckoutPaymentStep.php line 75 at CheckoutPaymentStepCore->render(array('identifier' => 'checkout-payment-step', 'position' => '4', 'ui' => object(RenderableProxy))) in RenderableProxy.php line 52 at RenderableProxy->render(array('identifier' => 'checkout-payment-step', 'position' => '4', 'ui' => object(RenderableProxy))) in smartyfront.config.inc.php line 94 at smartyRender(array('identifier' => 'checkout-payment-step', 'position' => '4', 'ui' => object(RenderableProxy)), object(Smarty_Dev_Template)) at call_user_func_array('smartyRender', array(array('identifier' => 'checkout-payment-step', 'position' => '4', 'ui' => object(RenderableProxy)), object(Smarty_Dev_Template))) in SmartyLazyRegister.php line 83 at SmartyLazyRegister->__call('smartyRender', array(array('identifier' => 'checkout-payment-step', 'position' => '4', 'ui' => object(RenderableProxy)), object(Smarty_Dev_Template))) in smarty_internal_templatebase.php(157) : eval()'d code line 36 at SmartyLazyRegister->smartyRender(array('identifier' => 'checkout-payment-step', 'position' => '4', 'ui' => object(RenderableProxy)), object(Smarty_Dev_Template)) in smarty_internal_templatebase.php(157) : eval()'d code line 36 at content_58a1d2f3df1031_29484816(object(Smarty_Dev_Template)) in smarty_internal_templatebase.php line 188 at Smarty_Internal_TemplateBase->fetch(null, null, null, null, false, true, false) in SmartyDev.php line 60 at Smarty_Dev_Template->fetch() in CheckoutProcess.php line 110 at CheckoutProcessCore->render(array('file' => 'checkout/checkout-process.tpl', 'ui' => object(RenderableProxy))) in RenderableProxy.php line 52 at RenderableProxy->render(array('file' => 'checkout/checkout-process.tpl', 'ui' => object(RenderableProxy))) in smartyfront.config.inc.php line 94 at smartyRender(array('file' => 'checkout/checkout-process.tpl', 'ui' => object(RenderableProxy)), object(Smarty_Dev_Template)) at call_user_func_array('smartyRender', array(array('file' => 'checkout/checkout-process.tpl', 'ui' => object(RenderableProxy)), object(Smarty_Dev_Template))) in SmartyLazyRegister.php line 83 at SmartyLazyRegister->__call('smartyRender', array(array('file' => 'checkout/checkout-process.tpl', 'ui' => object(RenderableProxy)), object(Smarty_Dev_Template))) in smarty_internal_templatebase.php(157) : eval()'d code line 140 at SmartyLazyRegister->smartyRender(array('file' => 'checkout/checkout-process.tpl', 'ui' => object(RenderableProxy)), object(Smarty_Dev_Template)) in smarty_internal_templatebase.php(157) : eval()'d code line 140 at content_58a1d2f36c1102_63778738(object(Smarty_Dev_Template)) in smarty_internal_templatebase.php line 188 at Smarty_Internal_TemplateBase->fetch('checkout/checkout.tpl', null, 'layouts/layout-full-width.tpl', null, false, true, false) in SmartyDev.php line 41 at SmartyDev->fetch('checkout/checkout.tpl', null, 'layouts/layout-full-width.tpl') in FrontController.php line 655 at FrontControllerCore->smartyOutputContent('checkout/checkout.tpl') in FrontController.php line 639 at FrontControllerCore->display() in Controller.php line 221 at ControllerCore->run() in Dispatcher.php line 366 at DispatcherCore->dispatch() in index.php line 28 I got the same error even for the fresh installation of version 1.7. Any clue on how to fix this? Hopefully Prestashop dev will fix it and upload a updated version. Link to comment Share on other sites More sharing options...
shacker Posted April 4, 2017 Author Share Posted April 4, 2017 didnt check in the last version Link to comment Share on other sites More sharing options...
jlquichimbo Posted July 19, 2017 Share Posted July 19, 2017 I try disabling the module Stripe from my modules, and it solve the problem. Try disabling or updating some pay module. I hope this helps. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now