Unwanted undefined index notice

greg.harvey - June 18, 2009 - 21:35
Project:Cache Router
Version:6.x-1.0-beta8
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

I'm getting this from file.php

Notice: Undefined index: cache in /path/to/drupal/sites/all/modules/cacherouter/engines/file.php on line 15

Affected line is:

<?php
// Assign the path on the following order: bin specific -> default specific -> /tmp/filepath
$this->fspath = $conf['cacherouter'][$bin]['path'];
?>

Seems $bin contains the wrong data. From what I can tell it ought to contain 'default' but seems to contain the actual cache "table" name instead?

Settings file is like this:

<?php
$conf
['cache_inc'] = './sites/all/modules/cacherouter/cacherouter.inc';
$conf['cacherouter'] = array(
 
'default' => array(
   
'engine' => 'file',
   
'shared' => TRUE,
   
'prefix' => '',
   
'path' => '/tmp/filecache/drupaler',
   
'static' => FALSE,
   
'fast_cache' => FALSE,
  ),
);
?>

I think bin is supposed to be the array key?

#1

greg.harvey - July 2, 2009 - 08:35

For information, call stack is:

Call Stack
# Time Memory Function Location
1 0.0000 45284 {main}( ) ../index.php:0
2 0.0003 66736 drupal_bootstrap( ) ../index.php:16
3 0.0421 124804 _drupal_bootstrap( ) ../bootstrap.inc:947
4 0.0421 124804 variable_init( ) ../bootstrap.inc:1000
5 0.0421 124804 cache_get( ) ../bootstrap.inc:438
6 0.0421 124804 CacheRouter->get( ) ../cacherouter.inc:27
7 0.0421 124804 CacheRouter->__init( ) ../CacheRouter.php:34
8 0.0422 130656 fileCache->__construct( ) ../CacheRouter.php:29

#2

slantview - September 3, 2009 - 07:46
Status:active» fixed

Fixed.

#3

System Message - September 17, 2009 - 07:50
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.