irina_b. Posted November 15, 2016 Share Posted November 15, 2016 (edited) Hi, I have wrote module that correctly works on local server (PS v 1.6.1.9). But when I upload this module to the server with working-site (PS v 1.6.1.5), I get incorrect data from controller. In this module Ajax sent json to controller. Controller-code: $json = json_decode($_GET["Data"]); $subject = "=?utf-8?B?" . base64_encode("Subject") . "?="; $message = "Name: '".$json->name."'\nPhone: '".$json->phone."'."; mail('[email protected]', $subject, $message, "Content-type: text/plain; charset=UTF-8\r\n"); echo json_encode('This is valid json.'); Local server sends correct data, but production server sends "Name ''\nPhone ''.". Can you help me? And one question: after uploading my module to shop I can't enter into section "modules and services". Production server says: [PrestaShop] Fatal error in module file :/var/www/a20160066/data/www/sandaly.com.ua/classes/helper/Helper.php: Call to a member function createTemplate() on a non-object Local server: Fatal error: Call to a member function assign() on a non-object in D:\Web\OpenServer\domains\prestashop\classes\controller\Controller.php on line 624 [PrestaShop] Fatal error in module file :\Web\OpenServer\domains\prestashop\classes\controller\Controller.php:Call to a member function assign() on a non-object How to сorrect this mistake? Edited November 15, 2016 by irina_b. (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted November 16, 2016 Share Posted November 16, 2016 how exactly are you sending JSON using GET? The correct way to obtain data from GET or POST is to use Tools::getValue('Data') Link to comment Share on other sites More sharing options...
irina_b. Posted November 16, 2016 Author Share Posted November 16, 2016 This problem has been solved. It was in the different versions of php servers. But problem of accessing to section "modules and services" is actual. I mistakenly added a module without views directory. What should I do to fix this? Link to comment Share on other sites More sharing options...
bellini13 Posted November 16, 2016 Share Posted November 16, 2016 can you elaborate on what you are asking? Link to comment Share on other sites More sharing options...
irina_b. Posted November 16, 2016 Author Share Posted November 16, 2016 (edited) In admin panel I connected the module to site. This module was without directory "view". Now I do not have access to section "modules and services" in admin panel. Production server says: [PrestaShop] Fatal error in module file :/var/www/[any_data]/data/www/[my_site]/classes/helper/Helper.php: Call to a member function createTemplate() on a non-object Local server: Fatal error: Call to a member function assign() on a non-object in D:\Web\OpenServer\domains\prestashop\classes\controller\Controller.php on line 624 [PrestaShop] Fatal error in module file \Web\OpenServer\domains\prestashop\classes\controller\Controller.php:Call to a member function assign() on a non-object This can be corrected by adding a folder 'view' with a template in the site architecture? If it possible, how? Edited November 16, 2016 by irina_b. (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted November 17, 2016 Share Posted November 17, 2016 access your ftp server and delete the module, or fix it by adding the missing folders/files Link to comment Share on other sites More sharing options...
irina_b. Posted November 17, 2016 Author Share Posted November 17, 2016 I can't find a place where I must to add the missing files 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