Jump to content

Undefined index: module_id


Recommended Posts

Hi,

 

I see in my error log this error:

 

Undefined index: module_id //// modules/posstaticblocks/ajax.php on line 7

 

Trying to get property of non-object in modules/posstaticblocks/ajax.php on line 9

 

 

This is the code of the php file:

 

<?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));
 
?>
 
How to solve???
Edited by robbie007 (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...