Reviewed & tested by the community
Project:
Image Browser
Version:
6.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Nov 2010 at 23:39 UTC
Updated:
5 Aug 2011 at 10:51 UTC
Jump to comment: Most recent file
Comments
Comment #1
rimian commenteddiff --git a/imagebrowser.module b/imagebrowser.module
index 3684491..9e7ab16 100644
--- a/imagebrowser.module
+++ b/imagebrowser.module
@@ -984,7 +984,11 @@ function imagebrowser_rebuild_cache() {
cache_set('imagebrowser_styles', $styles);
$css = file_directory_path() . "/ibstyles.css";
- $file = fopen($css, 'w') or die("can't open file");
+ $file = fopen($css, 'w');
+ if(!$file) {
+ drupal_set_message(t('Image browser could not open CSS file.'), 'error');
+ return;
+ }
$data = NULL;
foreach($styles as $style) {
$data .= '.ibimage_'. $style['name'] ." {\r\n". $style['css'] ."\r\n}\r\n\r\n";
Comment #2
rjmackay commentedJust hit this error. This is a really bad way to handle an error, especially in Drupal.
I've rolled rimian's comment into a patch - against current 6.x-2.x branch.
Comment #3
lazysoundsystem commentedThis is much better. Before, I was getting:
"can't open fileDrush command could not be completed."
and nothing more. This fixes the problem.
Comment #4
rjmackay commentedping.
Any change we could get this committed?
Comment #5
igorik commentedsubscribe.
is anybody maintain this module yet?