Casey Cao
Casey Cao

Reputation: 341

opencart php program stopped after dispatch()

My opencart front-end works well, while back-end /admin returns me blank page. I debugged my /admin/index.php and find after $controller->dispatch($action, new Action('error/not_found')); the program stopped. So I won't be able to see even the echo. Here is the code: Back-end admin/index.php

// Router
if (isset($request->get['route'])) {
    $action = new Action($request->get['route']);
} else {
    $action = new Action('common/home');
}

// Dispatch

var_dump($action);


$controller->dispatch($action, new Action('error/not_found'));

echo "second+++++++++++++++++++++++++++++++++";
var_dump($response);
// Output

$response->output();

By the way the frond end works well, as it returned me echo and $response value after dispatch:

if (isset($request->get['route'])) {

    $action = new Action($request->get['route']);

} else {

    $action = new Action($config->get('config_default_controller'));

}

// Dispatch
var_dump($action);
$controller->dispatch($action, new Action($config->get('config_default_controller_error')));

echo "second++++++++++++++++++++++++++";
var_dump($response);

I have checked the $action and $controller they are all with good values and paths. Do anyone know what happened here with dispatch ? or give me any information about dispatch and why the program stop. Thank you in advance.

Upvotes: 2

Views: 1111

Answers (1)

3y3skill3r
3y3skill3r

Reputation: 1026

after few hours i found solution.

In my case it was wrong config. I had same issue and after checking what is wrong i figure out that my paths in config.php file in admin folder was with wrong values.

Opencart have two cfg files.

Next thing what i changed was config_url in database. Hope it will help you.

Upvotes: 1

Related Questions