Latest *.dev from http://drupalcode.org/project/advagg.git

Nasty PHP E' Notice which adds many entries to php & drupal error *.log (one for every page and about 70 for a basic advagg rebuild):

<strong>Notice: Undefined index: all in advagg_process_css() (line 1670 of advagg.module)</strong>

*Fix* (edit the advagg.module)

    if ($public_downloads && $preprocess_css) {
-      $files_aggregates_included[$media] = $files_included[$media];
+      $files_aggregates_included[$media] = (!empty($files_included[$media]) ? $files_included[$media] : '');   // Patch: for 'Undefined index: 'all' and several others
      $files = array();
      foreach ($types as $type) {
        foreach ($type as $file => $cache) {
          if ($cache) {
            $files[] = $file;
            $files_included[$media][$file] = TRUE;
            unset($files_aggregates_included[$file]);
          }
        }
      }
      $preprocess_files = advagg_css_js_file_builder('css', $files);

It would be good if Drupal coders checked there own code with PHP 5.x Notices enabled!
PHP bugs are very often discovered this way!

CommentFileSizeAuthor
#1 advagg-1178688-1.patch615 bytesmikeytown2

Comments

mikeytown2’s picture

Status: Active » Fixed
StatusFileSize
new615 bytes

lol, I run with

// Report all PHP errors
error_reporting(-1);

on all my dev boxes. It's just the nature of PHP, what works on my setup may not work on yours. And in this case depending on what is added via drupal_add_css this can be triggered. For me it was never triggered. This is why php notices are so important, they show potential flaws in the logic of your implementation of the code. Thanks for the report and the following patch has been committed.

Status: Fixed » Closed (fixed)

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