#982970 by pfrenssen. Strict warnings in _image_devel_generate().
authormoshe weitzman
Mon, 29 Nov 2010 03:59:09 +0000 (03:59 +0000)
committermoshe weitzman
Mon, 29 Nov 2010 03:59:09 +0000 (03:59 +0000)
devel_generate/image.devel_generate.inc

index 8c5b280..2c6318a 100644 (file)
@@ -26,6 +26,7 @@ function _image_devel_generate($object, $field, $instance, $bundle) {
   // Generate a max of 5 different images.
   if (!isset($images[$extension][$min_resolution][$max_resolution]) || count($images[$extension][$min_resolution][$max_resolution]) <= DEVEL_GENERATE_IMAGE_MAX) {
     if ($path = devel_generate_image($extension, $min_resolution, $max_resolution)) {
+      $source = new stdClass();
       $source->uri = $path;
       $source->uid = 1; // TODO: randomize? Use case specific.
       $source->filemime = 'image/' . pathinfo($path, PATHINFO_EXTENSION);
@@ -41,6 +42,7 @@ function _image_devel_generate($object, $field, $instance, $bundle) {
   }
   else {
     // Select one of the images we've already generated for this field.
+    $file = new stdClass();
     $file->fid = array_rand($images[$extension][$min_resolution][$max_resolution]);
   }