levviking Posted April 8, 2018 Share Posted April 8, 2018 Am urmatoarea eroare in modulul mobilpay, prestashop 1.5.6.2 Ceva sfat? Multumesc. Notice: Undefined variable: e in /home/.../public_html/modules/mobilpay_cc/mobilpay_cc.php on line 428 Iar linia 428 si dupa este asa: if(!($e instanceof Exception)) { $smarty->assign(array( 'data' => $objPmReqCard->getEncData(), 'env_key' => $objPmReqCard->getEnvKey(), 'paymentUrl' => $paymentUrl )); } Link to comment Share on other sites More sharing options...
Marius05 Posted April 11, 2018 Share Posted April 11, 2018 Nu este eroare, este notificare. Link to comment Share on other sites More sharing options...
The Ge Posted April 12, 2018 Share Posted April 12, 2018 Este proasta practica sa neglijezi notificarile pe ideea ca nu sunt erori. Indiferent ce sunt, genereaza consum suplimentar de resurse si mesaje ce pot incurca raspunsurile serverului cand se lucreaza cu AJAX. @levviking Pentru o modificare minima poti adauga o verificare in linia 428, ceva de genul if(isset($e) && !($e instanceof Exception)) Sau poti repara logica: daca apare o exceptie se executa codul din } catch (Exception $e) { $error = $e->getMessage(); $errors = explode("\n", $error);//just first line $smarty->assign(['errors' => $errors]); return ''; //return $this->display(__FILE__, 'validation.tpl'); } (v1.0.0 a modulului, nu cred ca exista altceva), care opreste functie si returneaza un sir gol (observi ca este acelasi cod cu cel din else, linia 434, cred). Deci nu mai are sens testarea din linia 428, daca am ajuns acolo e clar ca nu exista $e. Asa ca blocul if-else if (!($e instanceof Exception)) { $smarty->assign([ 'data' => $objPmReqCard->getEncData(), 'env_key' => $objPmReqCard->getEnvKey(), 'paymentUrl' => $paymentUrl ]); } else { $error = $e->getMessage(); $errors = explode("\n", $error);//just first line $smarty->assign(array('errors' => $errors)); return ''; //return $this->display(__FILE__, 'validation.tpl'); } poate fi corectat/simplificat in //if (!($e instanceof Exception)) { $smarty->assign([ 'data' => $objPmReqCard->getEncData(), 'env_key' => $objPmReqCard->getEnvKey(), 'paymentUrl' => $paymentUrl ]); //} else { // $error = $e->getMessage(); // $errors = explode("\n", $error);//just first line // $smarty->assign(array('errors' => $errors)); // return ''; // //return $this->display(__FILE__, 'validation.tpl'); //} LATER EDIT: nu cred ca va exista o versiune actualizata a modulului, asa ca este destul de sigur sa faci modificarile direct in modul, Daca vrei vrei sa fii absolut sigur, fa un override la modul. Link to comment Share on other sites More sharing options...
levviking Posted April 26, 2018 Author Share Posted April 26, 2018 Mersi de sfaturi. Am incercat dar mi-a dat eroare 500. Probabil ceva nu am modificat corect. Mai incerc diseara. 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