I upgraded to the new version 6.x-2.0 from the previous version (which was working fine).

Now when I try and add a new Image advertisement, I get a message "Unable to locate image" after I fill out the Create Advertisement page. I have tried with various images that I have used before, tried adding them to a category and not adding them to a category, etc.

The images (JPGs) ARE going into the directory where the ads have been loading into using the old version (/sites/default/files) and they have the same CHMOD value (644) as the other (old) ads that are still successfully displaying on the web site.

I cannot see anything reading through the docs that I am supposed to change.

CommentFileSizeAuthor
#31 Imagen 3.png23.32 KBlcasassa

Comments

mad-town’s picture

Same problem:No images have been uploaded. Please upload an image via the File attachments form section below. Image is uploaded.
ad_flash missing flash file too.

Kevin.K’s picture

A "created" ad is placed in the "files" MySQL table, but the matching fid record is NOT placed in the "ad_image" table, thus the error message that the image cannot be found.

The new ad content is not successfully created.

I guess I will have to uninstall this and just either go with the old version or make my ads manually for the time being w/ no randomness.

jeremy’s picture

Status: Active » Postponed (maintainer needs more info)

What contrib modules do you have enabled? What OS are you using? This used to be a common bug in 5.x, but I've not seen it in 6.x.

Kevin.K’s picture

Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_bwlimited/1.4 PHP/5.2.9

Modules in use are:
CCK
GCal Events
Advanced Help
Secure Pages
Slideshow Creator
Teaser By Content Type
CAPTCHA (w/ Text CAPTCHA enabled)
jQuery plugins
Views

The Ad module was removed (uninstalled) since it was not working and I had a couple issues where all of a sudden it could not find any of the (already uploaded) ads to display. Since I did not want that happening on the production site, I removed it.

I can try and recreate the problem on my WampServer and see if I can isolate anything by disabling other modules, if that will help you?

Tezla’s picture

Same here.

I noticed this behavior...

When I first setup an Ad ... the Image Section (where you set the destination URL and MouseOver) is missing from the screen. So, I just set everything else and image file seems to upload ok. Then I click Save at the bottom, at the top of the screen, it says in green "Unable to Locate Image". (If I take a peak with my FTP program the image file is there). But if I scroll down, the Image section is finally there. So, I put in the URL (the file info is still filled in) and click save then it comes back at the top in red this time "It is required to Upload an image ...". The file section is blank now. So, I browse and upload it again, it renames it a bit (to prevent dups I guess) and then it finally works.

Fresh install of Drupal 6.11.
Modules:
Captcha
FiveStar
VotingAPI
FCKEditor (no uploads configured)
FAQ
UberCart 6.x-2.0-rc2
AND all Required and Suggested optional modules for UberCart (the list is on their install page ... but I can get them if you need them)

I turned on Upload Module and installed this 6.x-2.0 version toward the end. I already had UberCart working before. It uploads Product images with other modules.

One other thing I noticed ... after initial install there was no actual "default" Ad group setup. But, in Ad Reports and in layout Blocks ... it references one. Not sure where that is coming from because the only Ad Groups setup are the ones I setup myself.

Thanks for this module. It looks very nice.

jeremy’s picture

Do you have an ad blocker installed in your browser? If you disable it, does the problem go away?

Kevin.K’s picture

As posted by Tezla, multiple "Image Attachment" actions will make the image available for use. The first time through, the image cannot be found. I then do another upload, and the image is found successfully.

Through trial and error, I have developed a system to add an advert that results in one image being uploaded.

Go to add an ad.
Fill in the title, define as image type, and select NOT to post to front page.
Click save - prompt states that I need to upload an image.
Upload the image and click save.
The image will be uploaded and visible.
Then I edit and set the ad group, link, alternate text, and make it active.

socialnicheguru’s picture

happening to me too.

wexy’s picture

Getting same error, I upload the image several times but still getting error that I haven't uploaded it..

socialnicheguru’s picture

i have to check the list box before it will actually upload

wexy’s picture

Thanks! Checking the [x] list option next to the attached file makes things work.

jeremy’s picture

I've updated the README to document that "List" needs to be checked. However, this does not appear to be the problem with the original poster of this issue.

Does this solve the problem for everyone on this issue, or are there people for which checking "List" does not help?

Kethaera’s picture

I am one that has this issue even with "List" checked.

jeremy’s picture

Does the upload module work in general? Are the images successfully being uploaded? Did this ever work for you? What OS are you using? Have you tried multiple browsers? What else may be unusual about your installation?

socialnicheguru’s picture

the module does work.

the list checkbox does need to be checked.

In garland it is checked automatically. If there is a setting in upload that I might have overlooked, please let me know.

Kethaera’s picture

Does the upload module work in general?
Yes

Are the images successfully being uploaded?
Yes, the images are being successfully uploaded, I have to end up uploading them multiple time to the same ad, and I can see every one attached, but still the error.

Did this ever work for you?
Yes, eventually after several uploads, one will finally take. It does not seem to be consistent how many it takes. I upload a couple, then start deleting old ones at the same time as I try a new attempt.

What OS are you using?
Linux/MySQL, PHP 5.x

Have you tried multiple browsers?
Yes, IE8 and FF3.5

What else may be unusual about your installation?
I do have PathAuto and PathRedirect. Since they seem to be causing issues with Ad Channels, perhaps that is also the case here.

jeremy’s picture

Status: Postponed (maintainer needs more info) » Active

Interesting. It's a common enough issue that other people are running into it too, and yet it seems to only be affecting a subset of Ad module users. I've still been unable to duplicate it. I'll try and test with PathAuto and PathRedirect soon to see if there is a conflict -- I'd love to track this down.

Can anyone else confirm that they're also still having this problem? Do you see anything in common with what Kethaera is reporting?

jeremy’s picture

When you say PathRedirect, do you mean GlobalRedirect?

jeremy’s picture

Status: Active » Postponed (maintainer needs more info)

I enabled the PathAuto and GlobalRedirect modules but am still able create image ads without any problems.

What happens if you try creating image ads with user ID 1? Do you have the ad_owners module enabled? Does it help to disable this module?

Kevin.K’s picture

I originated this problem. Since I posted my workaround, I guess I gave it no thought since then - as it was working for me. If you are working on it again, I would be happy to test for you since I started the issue. If not, no worries. Just thought I would offer.

After reading the comments above, I went and tried to create another ad, using user #1 (which is the user I always use). I filled out the title, selected Image Ad, and uploaded a file. The list box was checked already (and always has been, as far as I know). I use the Newswire theme.

The error I received is the same as the error in the description of this issue, so it is not in the SQL database, however the image IS in the files directory, same as before.

If you want further testing by me, I will be happy to oblige. Creating the ad using my workaround works every time, the image is just uploaded on the second pass through, after I get the message that I must upload an image file.

Module checkboxes are: Ad, Ad click filter, Ad report, Ad weight probability, Image ad.

Kevin

Kethaera’s picture

Jeremy, it's actually Path Redirect http://drupal.org/project/path_redirect .

I have been using user ID 1, but I enabled a new account with ad permissions and tested, and it also has the image upload error. I did have Ad Owner enabled, but I disabled it, along with Ad File Cache. Still having the error. So I disabled Ad Channel. Still having the error. I removed all punctuation from my image name (I'm bad at abusing -'s and _'s). No go. I unchecked the URL alias option, so that no alias should be generated. Still getting the error.

My next step planned is to disable PathAuto and PathRedirect, but as I'm actually testing on a production site with a lot of user-generated content, I'm going to have to wait a low traffic time (probably at night US time) and put the site into maintenance mode while I do. Let me know if there's any other tests you'd like me to run while I do.

Oh, I'm using a custom Zen sub-theme. The ad modules I have enabled now are:
Ad
Ad Channel
Ad Embed
Ad Report
Ad Weight Probability
Image Ad
Text Ad

Would you like a list of all the modules we have enabled? It's a long one, my client has feature creep!

mikgreen’s picture

We've had similar problem here.
It went away after removing ad groups. Strange bug.

djudd’s picture

I was having this problem this morning while uploading 39 new ads to my site. Then I noticed that if I set the ad type to Image, but didn't hit select, I got that error.

If I set the type to Image, and hit the select button, no error. That's on me, I'm pretty sure that Select button is there for a reason.

maurizio.ganovelli’s picture

I had the same problem, also clicking on preview button not only on submit.
Don't know why, but I notice that at line 523 of ad_image.module sometimes in
foreach ($files as $file)
$file is not an object but an array so next if statement
if ($file->list && file_exists($file->filepath))
is always FALSE an code return the "Unable to locate image" error.
Just adding a type cast between the two lines
$file=(object)$file;
worked for me.
Hope It Helps.

Matt G’s picture

That's the fix!

I just installed the ad module today on a new site I'm developing.

I also had the "unable to locate image" error.

But the fix blackice78 described worked for me too.

I edited sites\all\modules\ad\image\ad_image.module

scroll down to line 523 and you'll see:

 foreach ($files as $file) { 
      if ($file->list && file_exists($file->filepath)) {

And I inserted $file=(object)$file; between those two lines:

 foreach ($files as $file) {

	  // fix for "unable to locate image" bug
	  $file=(object)$file;

      if ($file->list && file_exists($file->filepath)) {

Thank you blackice78.

jeremy’s picture

Status: Postponed (maintainer needs more info) » Fixed

Nice catch! Fix committed:
http://drupal.org/cvs?commit=292812

EastwoodArts’s picture

Still an issue here. Running Drupal 6.14 and the latest module version 2.2 (2009-Nov-30). Tried all the suggestions in the thread.

jdales’s picture

Version: 6.x-2.0 » 6.x-2.2
Status: Fixed » Active

This is still an issue. Using 6.x-2.2 I am unable to save an Image ad. The ad is stored in Bitcache, but the fid never gets set in ad_image

jdales’s picture

I went through and removed several modules (Bitcache, File and RDF). Now the Image ads load just fine. I think the issue was that the ad images were being pulled into the Bitcache module and converted. They were never in the folder that the Ad module was looking for them. Its fine with me if we close this issue.

jdales’s picture

After a long time playing around with this, I tried a fresh install and think I see the symptom, if not what's actually going on. If the Attachment module (part of the File Framework module http://drupal.org/project/fileframework) is enabled, then the ad images are stored in the Bitcache and not in the normal file system. When the ad system goes to operate on an add (display, approve, make active, etc...) the file isn't around. Also, the fid for the file doesn't get stored in the ad_image. I don't know if there's a way to tell the Ad module not to use the Attachement module when loading images for image ads. If there isn't then I'd say these two modules may not be compatible with each other.

lcasassa’s picture

StatusFileSize
new23.32 KB

I get the same error...
And I allready have:

foreach ($files as $file) {
if (is_array($file)) {
$file = (object)$file;
}

:/

trevorforrest’s picture

I think i may have found a workaround......
Iwas having the same problems described above and noticed that my adminitration theme was Gnot the same as my site theme. This setting i had selected at install....BUT I also selected 'use administration theme for content editing'. The minute i turned this off, everything worked fine.

dontgoquietly’s picture

Component: ad module » ad_image module
Priority: Normal » Critical

Still an issue. I was running 6..x-2.0, it was working fine, then I updated to 6.x-2.2. Now it doesn't work, I have tried rolling back to both 2.1 and 2.0, I have tried the workarounds and applied the fix to 2.0. I disabled all other modules, and it still doesn't work. The issue seems to center around the ad_image mysql table, saving ads (or editing existing ones) does not alter the table any more, FIDs are no longer saved. This has broken the ads on the site.

emilyf’s picture

same problem with latest 6 dev version.

jzevallos24’s picture

setting content edit to the admin theme fixed the problem for me

hschott’s picture

Using a template monster theme. Had to set the admin theme to garland and then it worked. Is there a way to make it work with the themplate monster theme?

drjonez’s picture

Still an issue :(

aviggngyv’s picture

i think so

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!