Whenever I try to create an Image Ad I get the following error.

"It is required that you upload an image for your image advertisement."

I've tried uploading an image for the ad using Image Assist, Image Properties & Image Uploads. Each seem to upload the image but when I hit Save I just get that error. What is supposed to be used to upload an image on an Image Ad?

Thanks.

Comments

fenix_75’s picture

I am having exactly the same error. The image is indeed uploaded.

fenix_75’s picture

function ad_image_active_file($files = array()) {
  
  if (is_array($files)) {
    foreach ($files as $fid => $data) {

      if (is_array($data)) {
        if ($data['list'] && !$data['remove']) {
          return $fid;
        }
      }
      else if ($data->list && !isset($data->remove)) {
        return $fid;
      }
    }
  }
    return 0;
}

The error is caused by above code. Cause it always return 0 ;
When I changed id to

function ad_image_active_file($files = array()) {
  
  if (is_array($files)) {
    foreach ($files as $fid => $data) {

      if (is_array($data)) {
        if ($data['list'] && !$data['remove']) {
          return $fid;
        }
      }
      else if ($data->list && !isset($data->remove)) {
        return $fid;
      }
    }
  }
	if ($fid) {
   return $fid;
	} else {
	 return 0;
	} 
}

the error goes away. Can somebody confirm that what I am doing is right?

fenix_75’s picture

Category: support » bug
fuquam’s picture

Which file did you change that code in?

promes’s picture

Today I installed the advertisement module in a new site (D6.22). After solving a PHP5.3 error (see http://drupal.org/node/925580) I got this error as well.
I found above code in ad_image.module and the fix did work for me. But only after upgrading TinyMCE to version 3.4.2.

lrwebks’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Drupal 6 is EOL and no longer supported. Closing this as outdated for that reason. Thanks for your contribution!