Notice: Undefined index

As youll probably understand, my knowlege about PhP is very little. But i’m trying anyway :slight_smile: Anyone here who can help me with this probleM?

Notice: Undefined index: 3 in /customers/3/1/3/xxxxx.xx/httpd.www/catalog/controller/module/carouselot.php on line 17

$this->data['name'] = html_entity_decode($setting['name'][$this->config->get('config_language_id')],  ENT_QUOTES, 'UTF-8');

Notice: Undefined index: 3 in /customers/3/1/3/xxxxxx.xx/httpd.www/catalog/controller/module/bannerot.php on line 14

$this->data['name'] = html_entity_decode($setting['name'][$this->config->get('config_language_id')],  ENT_QUOTES, 'UTF-8');

I have a feeling either…

[php]$this->config->get(‘config_language_id’)[/php]

or

[php]$setting[‘name’][$this->config->get(‘config_language_id’)][/php]

isn’t returning a value.

You can test it by adding this just before it, to see if it outputs a value.

[php]echo $this->config->get(‘config_language_id’);
echo $setting[‘name’][$this->config->get(‘config_language_id’)]
exit;[/php]

It didnt make the problem go away :confused:
Maybe the whole code will make it easier?

thank you for taking a look at this :slight_smile:

[code]<?php
class ControllerModuleBannerot extends Controller {
protected function index($setting) {
static $module = 0;

	$this->load->model('design/banner');
	$this->load->model('tool/image');
	
	$this->document->addScript('catalog/view/theme/fortis/js/cycle2/jquery.cycle2.js');
	
	$this->data['width'] = $setting['width'];
	$this->data['height'] = $setting['height'];
	$this->data['columns'] = $setting['columns'];
	$this->data['name'] = html_entity_decode($setting['name'][$this->config->get('config_language_id')],  ENT_QUOTES, 'UTF-8');
	
	$this->data['banners'] = array();
	
	if (isset($setting['banner_id'])) {
		$results = $this->model_design_banner->getBanner($setting['banner_id']);
		  
		foreach ($results as $result) {
			if (file_exists(DIR_IMAGE . $result['image'])) {
				$this->data['banners'][] = array(
					'title' => $result['title'],
					'link'  => $result['link'],
					'image' => $this->model_tool_image->resize($result['image'], $setting['width'], $setting['height'])
				);
			}
		}
	}
	
	$this->data['module'] = $module++;
					
	if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/bannerot.tpl')) {
		$this->template = $this->config->get('config_template') . '/template/module/bannerot.tpl';
	} else {
		$this->template = 'default/template/module/bannerot.tpl';
	}
	
	$this->render();
}

}
?>[/code]

It wasn’t suppose to make the problem go away. It was suppose to help you identify what the cause of the problem is.

Did you add the code I asked you to add right before the line that gives you the error?

If so which of the lines in the code I provided returned the same error.

Sponsor our Newsletter | Privacy Policy | Terms of Service