Closed (fixed)
Project:
Advertisement
Version:
5.x-1.x-dev
Component:
ad_image.module
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
23 May 2007 at 01:36 UTC
Updated:
2 Aug 2007 at 00:06 UTC
I am able to create an image ad in the default group but it will not display on the front end. Additionally, i get this error message when i view the edit screen in the admin:
* warning: imagejpeg() [function.imagejpeg]: Unable to open 'files/preview/d04310708dd997a47cd4b819f491862a.jpg' for writing: No such file or directory in /home/.preacher/sportsbiz/drupal/includes/image.inc on line 321.
* The selected file files/warsaw.jpg could not be uploaded, because the destination is not properly configured.
Any help would be appreciated.
Comments
Comment #1
jeremy commentedPerhaps review this thread which discusses a similar problem. It sounds like you've got a permissions problem...
Comment #2
jeremy commentedYou may also want to review this link which offers a lot of information that you might find helpful.
(I found both of these links with a quick Google search...)
Comment #3
jdblank commentedThanks for the links. Unfortunently that did not solve my problem. My banner infact is being uploaded despite the error message.
However it won't display. When i view source of a page that should display the banner I notice this tag:
There is nothing in the src="" I am wondering if that is the problem.
Comment #4
jeremy commentedAre you using the public or private download method?
Does this problem only happen when using the development branch? ie, do you have the same problem with the last stalbe release, 5.0-1?
As you're testing the development tree, please install the latest version then do a view source of your webpage and find the adserve.php link, then copy that url into your browser, adding a &debug=2 at the end and post the resulting output here.
Comment #5
jdblank commentedI am using the public method for files to download. Here is the debug output. I installed the latest dev version.
------
ad_dir: '/home/.preacher/sportsbiz/drupal/sites/all/modules/ad'
debug: '2'
cache: 'none'
nids: ''
tids: ''
hostid: ''
quantity: '1'
Root drupal directory detected as '/home/.preacher/sportsbiz/drupal'.
/home/.preacher/sportsbiz/drupal/sites/all/modules/ad/adserve.php: // $Id: adserve.php,v 1.2.2.15.2.15 2007/05/23 14:54:20 jeremy Exp $
/home/.preacher/sportsbiz/drupal/sites/all/modules/ad/ad.module: // $Id: ad.module,v 1.2.2.29.2.27 2007/05/24 16:32:04 jeremy Exp $
No cache enabled.
Drupal bootstrap '7'.
ad:
stdClass Object
(
[aid] => 1012
[adtype] => image
[redirect] => http://beta.sportsbusinessradio.com/ad/redirect/1012
[activated] => 1180071503
[maxviews] => 0
[maxclicks] => 0
)
Loading module 'sites/all/modules/ad/image/ad_image.module'.
Ads displayed: 1
document.write('
');
Comment #6
jeremy commentedI do not see any ad module code on the website http://beta.sportsbusinessradio.com/. How are you trying to display ads? Also, have you configured proper permissions? Please review the INSTALL and README files that are included with the module to be sure you have followed all directions there.
Comment #7
jdblank commentedI have followed all of those instructions.
When I view source I see ad info towards the bottom of the page:
Comment #8
jeremy commentedIt looks like your posting got cut off. If you were trying to post html, wrap it in <code></code> tags so that Drupal.org doesn't strip it.
I stand corrected, there is ad information on that page -- but ads are not showing because permission was not granted. This is what I see:
Comment #9
jdblank commentedWhen you say permission do you mean the access control permission because have show ads checked for anonymous users. Or do you mean some other permissions.
Here is what I see at the bottom of the homepage:
Comment #10
jdblank commentedI think something might be wrong with the ad group. I created a group called sponsors but the code does not indicate that group.
Comment #11
jdblank commentedOk, i deleted my original ad (the only one i had in the system) and recreated it.
The ad still does not show but there is much more code now:
Comment #12
jeremy commentedYou are currently trying to use views to select ads -- that's more complicated. I would suggest first start with the default blocks provided by the module and confirm that it works for you first. Only then should you navigate your way into something more complex.
In your first example, t=2, this was a taxonomy based block. But there are no ads assigned to term id 2:
term is 2
The second is node based, but again there are no ads that are assigned to these nodes:
nodes
With a little experimentation, I see that your ad is assigned a tid of 6:
term is 6
So, build a block that displays ads with a tid of 6, and you will see your ad.
Comment #13
jdblank commentedOK, I switched it to the default ad group and now i see some code that it looks like it should all work but it still does not display.
Josh
BTW - Thanks for all your help!
Comment #14
jeremy commentedWhen I manually try the adserve url that's in your page source, it works fine. But as with you, I don't see it on your page. I don't see any obvious reason for this.
I do see that adserve.php is pointing to www.sportsbusinessradio.com, not beta.sportsbusinessradio.com. Is that intentional?
Comment #15
jdblank commentedyeah, we are no longer in beta any more and moved the site to live.
Comment #16
jeremy commentedI think I duplicated your problem on my test website. Somehow I managed to upload an image ad and confuse the ad_image module into thinking that the image was of 0 height and 0 width. The simplest solution is to just edit the ad -- save it (without even making changes) and it should recalculate the image size. Once it does that, I'd expect it to start showing up again.
(However I see that now there are no ads in the default group that you're trying to display on the beta site -- perhaps you disabled it.)
I will fix this bug, but please confirm that this is indeed the problem you are having. (I'm changing the title as I'm relatively confident this is your problem.)
Comment #17
jdblank commentedThat is exatly the problem. Made my ad active and it now has a image height and width of 0. Editing and saving does not fix this for me on Mac FireFox.
Comment #18
jpsalter commentedI had the same problem and did not want to figure out why images were 0 x 0. So, I edited the ad_image.module function ad_image_display and removed the code that inserts the height and width:
Comment #19
jeremy commentedI'm not sure why this problem is consistently happening for you -- I've only had it happen once and was not able to duplicate it again.
Does the problem also happen with Safari? I doubt it's a Mac-specific bug, but it's worth checking.
Adding logic to prevent the activation of ads with a 0 size is simple, but it sounds like that won't be enough to fix your problem. I do intend a major rewrite of the ad_image module in the relatively near future, perhaps during that rewrite I will fix your problem.
Comment #20
fax8 commentedActually I have exactly the same issue here and this is also a problem for my work on the flash plugin.
I don't think that this is an issue with the browser but something related to the module logic. I've been able to reproduce this on Firofox and Konqueror both on Linux.
Unfortunately, even if I spent a reasonable amount of time on this issue, I still not been able to figure out what is happening here.
Have a look at my ad_image table:
You can see that the size fields are sometimes empty, same for the fid.
Something is wrong with the image validations functions and the image loading ... but I wasn't able to fix this.
I can give you access to the server where I'm having this issues, just contact me.
Comment #21
jeremy commentedI have added code to prevent image ads from being saved if they have a 0 size. This should prevent the confusion of ads not displaying properly, but will of course cause frustration for people that are affected by this bug -- hopefully they will step up and help better debug this problem.
Code was added to both the 4.7.x and 5.x development trees.
However, this bug still exists so I am not closing this issue.
Comment #22
awizon commentedI downloaded the ad-5.x-1.1.tar.gz module and installed it. I am using Firefox 2.0.0.3 on a MacBook Pro and the ad displays when I am logged in as the administrator, but does not display otherwise. I checked the logic in Drupal for users that can see the ad and no boxes are checked. I believe this is the same problem discussed above. I am new to Drupal, but have done a lot of work with it in a short time (no programming changes though!). Is there a fix that I missed?
Comment #23
awizon commentedMy bad, I needed to active advertisement permissions in the User Management page. Sorry about that.
Comment #24
ryo commentedSubscribing
Comment #25
tic2000 commentedThe error message in the first post of this issue is generated bu Upload Preview module. Try to disable that module and see if it solves your problem.
Comment #26
tic2000 commentedComment #27
rbottoms commentedHi, has someone fixed this problem? I see it's been discussed for weeks. I do understand PHP, but frankly all I want to do is download the module and use it to put ads on my site not debug code that people who are better programmers than me can't fix. How about adding two fields where I tell the module the size of my ad?
I am amazed that this is the only module that sorta kinda works in 5.xxx. Wouldn't the ability to run ads on Drupal sites be a #1 priority someplace? Hell this is the type of thing I'd pay money for.
Comment #28
jeremy commentedThe problem is not fixed, primarily because I'm unable to consistently duplicate it. I've randomly hit upon it once or twice, but being unable to consistently duplicate it makes it rather difficult to fix. If I found a way to consistently duplicate it, it'd be fixed.
If you're unable to help debug the problem, you could try undoing this change, and then modify the ad_image_display_ad function to not set the height and width. It doesn't bring us any closer to a real solution, but would get you up and running.
Comment #29
jeremy commentedAs reported here, the bug seems to be tied to not having defined any ad groups. Now knowing how to consistently duplicate the problem, a fix should be forthcoming (once I'm not traveling).
In the interim, you should be able to work around the problem by creating an ad group, and assigning your image ads to that ad group.
Comment #30
owen barton commentedI just posted a patch over at http://drupal.org/node/153319 for the case of this error occurring when there are no group terms selected (e.g. on a clean install).
I'll leave this open in case there are other situations (e.g. messed up image processing) that are causing this problem.
Comment #31
jeremy commentedBelieved fixed in this issue in the development tree.
Comment #32
(not verified) commented