$csspath = 'public://css';
  if (!empty($css)) {
    file_prepare_directory($csspath, FILE_CREATE_DIRECTORY);
    file_unmanaged_delete($csspath . '/menu_icons.css');
    file_unmanaged_save_data($css, $csspath . '/menu_icons.css', FILE_EXISTS_REPLACE);
  }
  else {
    file_unmanaged_delete($csspath . '/menu_icons.css');
  }
}

It seems like this 'notice' message I'm seeing after each cron is run is coming from these lines of code. I never set this module to use the default CSS option in the admin page. I'm wondering if the else arguement needs a bit more then simply else?

Perhaps a elseif file_exists($path) where $path = $csspath . '/menu_icons.css'.

Or maybe something that makes it not run on every cron?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cybermache’s picture

Maybe this would be good? At least works for me as far as I can tell.

+  $path = $csspath . '/menu_icons.css';
  if (!empty($css)) {
    file_prepare_directory($csspath, FILE_CREATE_DIRECTORY);
    file_unmanaged_delete($csspath . '/menu_icons.css');
    file_unmanaged_save_data($css, $csspath . '/menu_icons.css', FILE_EXISTS_REPLACE);
  }
  else {
+    if (file_exists($path)) {
      file_unmanaged_delete($csspath . '/menu_icons.css');
+    }
  }
hawkeye.twolf’s picture

Category: Feature request » Bug report
Issue summary: View changes
Status: Active » Needs review
FileSize
949 bytes

Patch attached.

kevinchampion’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
947 bytes

Works for me.

Tiny thing, but patch contains an extraneous space. Here's another.