When I create an image ad, it's set by default as Pending. If I try to change it directly from Pending to Active, when I save it I get the following error:
Image validation failed, unable to mark ad as active. Setting ad as pending. If you do not see any more errors, you should now be able to set your ad as active.
I can set it to Approved successfully, but when I try to change it from Approved to Active, I get the same error and the ad reverts to Pending status.
I'm working as an admin user, with all permissions turned on. I can work with text ads correctly. The error happens with both .gif and .png ads, which are created in Photoshop... so what is "image validation" and why doesn't it like them?
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 153319.patch | 899 bytes | owen barton |
| NYT_184x90_450_rgt.png | 6.14 KB | adam_b |
Comments
Comment #1
jeremy commentedThis is a known issue which I've not had time to debug. At this time I'm unsure why some people have this problem intermittently, and other people have the problem all the time. I'm currently traveling, but once I settled down in early July I plan a complete rewrite to introduce new functionality that I require, and will address this bug at that time. Of course, anyone that's able to debug the problem before that please feel free to submit a patch.
Comment #2
adman4054 commentedJust FYI. I 'm using Drupal 5.x and downloaded the "ad module" for this version. The 5.x version and the 4.7 seem to be the same. I noted that on the "install.txt" of the 5.x version it says 4.7, maybe wrong download?
Comment #3
jeremy commentedThe 4.7 version of the ad module wouldn't work at all on Drupal 5.x. The version reference in the INSTALL.txt file was fixed after 1.1 was released.
Comment #4
yodersj commentedI was getting this same issue until I created an Ad group and selected it for my ad. It appears if you select the "<none>" option it becomes unselected. At least that's my observations. Sometimes I'll still get that image validation failed when an ad group is selected, but not every time.
Note: I'm using 4.7.x, but the "fix" could be the same for 5.1.x. Of course, now I'm seeing something like this bug.
Comment #5
adman4054 commentedThat fix worked for me on 5.1
Comment #6
jeremy commentedThanks yodersj. Indeed, it becomes easy to duplicate this problem when there are no ad groups. That should make it easy to track down and fix. Unfortunately I'm mid-route in my travels, but within a week I'll be settled down and will address this bug.
In the mean time, people wanting to work around this problem should try creating an ad-group and assigned their ad to that group.
Comment #7
Andreas Wolf commentedThe bug is in function ad_image_validate_size($file, $nid) {
No terms -> no foreach -> function returns false -> ad_image_load_image returns false -> ad_image_adapi throws "Image validation failed, unable to mark ad as active."
Btw. setting a term AND marking the ad as active does not work. You have to set a term, submit and then mark the ad as active.
Comment #8
owen barton commentedHere is a patch that makes this work even when to group is selected (or even created). It's slightly hacky, in that it just creates a single NULL array element if the array is empty to ensure that it goes into the foreach and gets the default image settings - ad_image_format_load() is designed to accept a NULL value anyway, so this is not massively out of line.
If we wanted to do this a somewhat cleaner way we could move the guts of the foreach to another function and then call in once if there are no terms, or through the foreach if there are terms.
Comment #9
owen barton commentedComment #10
jeremy commentedThis will work for now. I'm planning a rewrite of the image_module which will change a lot of this handling (decoupling it from the upload module, among other things), so for now we just need it to work.
I'm planning to make a run through the issue queue next week, and will merge this patch at that time, among others.
Comment #11
fufi commentedIn case anyone else had the same issue, i still couldn't activate an ad after adding it to a group, but then i set it to Approved first, and then Active, and it worked
Comment #12
jeremy commentedPatch committed. Thanks! :)
Comment #13
welsh commentedI am still having problem despite the patch and workaround. I am getting error messages such as "Unable to locate image c:\windows\temp\tmp14E.tmp" even though the temporary file exist. I am running Drupal on IIS. Does anybody know if I have to set any security settings on the temporary directory?
Comment #14
jeremy commentedWelsh, your problem is with the configuration of IIS and the upload module, not the ad module. Try searching the support forums, mailing list archives, etc -- I have no experience with IIS and the upload module. You might start with this comment, found with a google search.
Comment #15
(not verified) commentedComment #16
hyperart commentedThe problem seems to be with the default "ad owner" permissions after you add an ad.
Within an ad's settings, go to "ad owners", and then "admin's permissions", you will see that by default not all the permissions are checked. You'll want to be sure to check "manage active ad". After that, you should be able to set your ad as active.
At least this has been working for me. I don't know why the ad owner wouldn't have these permissions ON by default...but looks like changing it makes it all work.
Comment #17
jmlavarenne commentedEven with the permission to manage own ads I still get the same issue.
Comment #18
rmjackson commentedI'm getting the same problem: "Image validation failed, unable to mark ad as active. Setting ad as pending." Using the recent 5.x-1.x-dev version on 5.1. I'm just downright perplexed.
Comment #19
dtj commentedUnder the "File attachments" section of the ad, click the "List" checkbox. That fixed it for me.
Comment #20
jefftrnr commentedbe SURE you upload image advertisements to "File attachments", not to "Attached Images", if they both exist. This fixed it for me.
Comment #21
kompatv commentedI was able to fix this error by unselecting "Promote to Front Page"