hi,
i know this module is just in the works but hey this is a bit over the top *g

notice: Undefined index: bytes_used in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 58.
notice: Undefined index: bytes_total in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 58.
warning: Division by zero in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 58.
notice: Undefined index: hits in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 69.
notice: Undefined index: misses in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 76.
notice: Undefined index: gets in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 87.
notice: Undefined index: sets in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 94.
notice: Undefined variable: req_sets in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 98.
notice: Undefined index: bytes_used in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 108.
notice: Undefined index: bytes_total in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 109.
notice: Undefined index: bytes_used in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 109.
notice: Undefined index: hits in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 110.
notice: Undefined index: misses in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 111.
notice: Undefined index: gets in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 112.
notice: Undefined index: sets in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 113.
notice: Undefined variable: req_sets in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 113.
notice: Undefined index: req_rate in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 124.
notice: Undefined index: hit_rate in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 130.
notice: Undefined index: miss_rate in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 136.
notice: Undefined index: set_rate in /var/www/drupal-hfopi/sites/all/modules/cache/cache.admin.inc on line 142.

as it seems most developers have not set the warnings to 'enabled', it seems like a good idea to create a module for patching index.php to show EVERYTHING... mmhh expect to see that module soon as i can't stand much longer this flood of notices in every contrib piece of code i activate.. jeez running SELECT * from `watchdog` WHERE `variables` REGEXP 'modulename.module' every now and then can not possibly overcharge module devs too much huh...

Comments

eMPee584’s picture

wow... i just discovered that my

error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

at the beginning of index.php has no effect at all and the error logging settings option 'to log AND TO SCREEN' already does include PHP warnings and notices...
This means that there's absolutely NO excuse for ANY module to ship with obvious errors, some even on EVERY page call like f.e. this code:

/**
 * Implementation of hook_help().
 */
function cmf_help($path, $arg) {
  switch ($section) {
    case "admin/help#cmf":
      $output = '<p>'. t("This module adds an easier way for administrators to filter the content on a Drupal site for administration purposes.") .'</p>';
      $output .= '<p>'. t("It's an improvement over the content page in the administration area of Drupal. It can show on the same page nodes and comments and adds new filters like role and author.") .'</p>';
      break;
  }
  return $output;
} 

this really comes as a shock to me, meaning that hundreds of contrib module developers don't give a FSCK about error messages AT ALL (you excluded, of course). Great prerequisite of publishing code that is potentially being run on up to 100000 drupal sites. WTFOMG!!1!!!11eleven

melon’s picture

This will be a great module, keep up the good work doq!

I suppose the division by zero error comes at bins where $stats['bytes_total'] is zero. I think this is the case with database bins (would be there any other bins like this?)
Perhaps a quick fix would do fine with a check that no statistics should be generated for database caching at all.

doq’s picture

Assigned: Unassigned » doq

Statistics not supported. message will be shown for bins caching implementations of which doesn't support statistics.

doq’s picture

Status: Active » Fixed
eMPee584’s picture

Hey doq if there are no statistics for that module, some code should prevent trying what is being tried. IMHO, no user action or page request should produce any PHP warnings.

doq’s picture

Ok, can you please try latest 1.0-alpha6?

Status: Fixed » Closed (fixed)

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