After uploading images by ad_image module, they all have fid=0 and not shown in blocks. Can you tell me what to do?

Comments

jeremy’s picture

Status: Active » Postponed (maintainer needs more info)

Are you using the core drupal upload module? Is the upload module working in general?

Does the problem happen with the last stable release of the ad module?

What version of Drupal are you using? What OS? How did you track down the fid issue?

rasmusmohr’s picture

I've run into the same issue. After creating a new image ad, the fid attribute has the value 0 in ad_image table. The actual file entry is correctly created in the files table - by manually inserting the missing fid in ad_image the issue is solved (for this particular ad).

I'm using the core upload module (it works - verified with creation of non-ad content) and Drupal v. 5.3, Advertisement version is 5.x-1.4-1 (2008-Jan-13).

jeremy’s picture

When this happens, if you go back and edit the ad (without making any changes, necessarily) and submit it, does the image then appear? In other words, does this only happen when the ad is first created?

rasmusmohr’s picture

Editing the ad (without making changes) does actually fix the problem - the correct fid is inserted into ad_image and the image is displayed correctly.

Any clue to what's going on?

jeremy’s picture

Assigned: Unassigned » jeremy
Status: Postponed (maintainer needs more info) » Active

Not offhand, except I think I've duplicated it. I'm off for the weekend, but hopefully I'll get time to look into this next week. That area of the ad_image module is, ugly, so no surprise there's a bug there...

jeremy’s picture

Not offhand, except I think I've duplicated it. I'm off for the weekend, but hopefully I'll get time to look into this next week. That area of the ad_image module is, ugly, so no surprise there's a bug there...

Skyery’s picture

Thank you for answers, your tip was helpful.

jeremy’s picture

Status: Active » Fixed

It turned out being a very simple fix. Committed to the development branch.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.