damuz91
damuz91

Reputation: 1728

Prestashop 1.6 blank page no error reporting

I have turned on error reporting and debug mode:

//defines.inc.php
define('_PS_MODE_DEV_', true);
@ini_set('display_errors', 'on');
define('_PS_DEBUG_SQL_', true);

Also i have tailed -f php_error.log, apache_error.log, mysql_error.log Only relevant i got is:

[01-Dec-2014 10:12:07 America/Bogota] PHP Notice:  Trying to get property of non-object in /Users/david/Documents/Developer/Php/PuntoCompra/puntocompra/modules/posstaticblocks/ajax.php on line 9
[01-Dec-2014 10:12:07 America/Bogota] PHP Fatal error:  Uncaught You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 4<br /><br /><pre>
            SELECT m.*
            FROM `puntocom_module` m
            JOIN `puntocom_module_shop` ms ON (m.`id_module` = ms.`id_module` AND ms.`id_shop` = 1)
            WHERE m.`id_module` =  LIMIT 1</pre>
  thrown in /Users/david/Documents/Developer/Php/PuntoCompra/puntocompra/classes/db/Db.php on line 635

I dont think this has something to do, since the front and backoffice are working fine except that when i submit or update a product i got a blank page. This is happening in both develpment and production environments.

Anyway here is my ajax.php

require_once(dirname(__FILE__).'../../../config/config.inc.php');
require_once(dirname(__FILE__).'../../../init.php');
include(dirname(__FILE__).'/posstaticblocks.php');

 $pos = new posstaticblocks();
 $name_module = $_POST['module_id'];
 $module = Module::getInstanceByName($name_module);
 $id_module = $module->id;
 $hooks = $pos->getHooksByModuleId($id_module);
 $hookArrays = array();
 foreach($hooks as $key => $hook) {
    $hookArrays[$key] = array('id_hook'=>$hook['name'], 'name' => $hook['name']);
 }
 $json = json_encode($hookArrays); 
die(json_encode($json));

Also i think this is not related but in my front office only in development environment i've got this:

 Notice: Undefined property: Possearchcategories::$_html in /Users/david/Documents/Developer/Php/PuntoCompra/puntocompra/modules/possearchcategories/possearchcategories.php on line 237

I have also cleared the cache.

Where else can i seek out for this problem?

Edit: This is my url before the product update:

//localhost:8888/adminxxxx/index.php?controller=AdminProducts&id_product=10&updateproduct&token=019b50f16c6927fc989c8d98fa9ebbed

And this is after my update

//localhost:8888/adminxxxx/index.php?controller=AdminProducts&token=019b50f16c6927fc989c8d98fa9ebbed&id_product=10

I have inspected the network response and this is what firebug shows:

ajax post response?

empty response

This makes me think that ajax answer with non responding request in the ajax.php file mentioned above has the fault in this matter. It seems that there is a missing module..

Edit 2:

Turns out that when loading the products page there is the following ajax post request:

POST //localhost:8888/modules/posstaticblocks/ajax.php

With the following parameters:

module_id   undefined

And the response:

"[{\"id_hook\":\"displayFooter\",\"name\":\"displayFooter\"},{\"id_hook\":\"displayHome\",\"name\":\"displayHome\"},{\"id_hook\":\"displayLeftColumn\",\"name\":\"displayLeftColumn\"},{\"id_hook\":\"displayRightColumn\",\"name\":\"displayRightColumn\"},{\"id_hook\":\"displayTop\",\"name\":\"displayTop\"}]"

So i've done the following don't kill me please mod:

// /modules/poststaticblocks/ajax.php
$name_module = $_POST['module_id'];
if($name_module == "undefined")
    $name_module = "posstaticblocks";

And the error is gone!, but the blank page is still showing

Upvotes: 2

Views: 4577

Answers (1)

Awssam Saidi
Awssam Saidi

Reputation: 437

change the line 451 in /controllers/admin/AdminModulesPositionsController.php

$all_modules_controllers = Dispatcher::getModuleControllers($type);

to

$all_modules_controllers = Dispatcher::getControllers($type);

Which seems to have eliminated the problem, without giving new problems.

So it has to be a bug in the new Prestashop ver. 1.6.0.6

Upvotes: 1

Related Questions