Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
$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?
Comment | File | Size | Author |
---|---|---|---|
#3 | menu_icons-php-notice-on-file-delete-2101611-3.patch | 947 bytes | kevinchampion |
#2 | menu_icons-php-notice-on-file-delete-2101611-2.patch | 949 bytes | hawkeye.twolf |
Comments
Comment #1
cybermache CreditAttribution: cybermache commentedMaybe this would be good? At least works for me as far as I can tell.
Comment #2
hawkeye.twolfPatch attached.
Comment #3
kevinchampion CreditAttribution: kevinchampion commentedWorks for me.
Tiny thing, but patch contains an extraneous space. Here's another.