I wanted to demote my advertisement node from the front page, but when saving my changes, I got "It is required that you upload an image for your image advertisement".

I don't want to change the image or reuplaod the same image, so the code should check if the node already has in image.

Comments

heathergaye’s picture

Righto, I think I've worked out what's causing this. To replicate the problem, follow these steps:

* Configuration involves having more than one ad type module enabled - eg image, html, text
* Nav to node/add/ad and enter a dummy title
* Select ad type "image" from dropdown, but don't click the "select" button.
* Attach an image file; click the "list" button next to file (necessary as outlined by module).
* Save the ad. You'll get directed back to the edit form, and you have to click "Save" again. The ad will display correctly, but the uploaded file will have disappeared from the list.
* You'll get the error on all subsequent edits.

Quick fix... train all users to click that magical "select" button after choosing from the ad type dropdown.
Quick fix for existing ads is to edit & re-upload the image.

Dev notes: I'm not in a position to trace through & fix this problem, but here's what's happening if anyone's got the time & inclination to submit a patch: clicking the main "Save" button without first clicking the interim "select" runs the "select" submit function, but also *does-some-other-blurry-stuff* with the form, without actually doing a proper save. When the form is re-displayed, the node has not yet been created, but the uploaded file in the list is marked as "existing", which stops the upload module inserting a new upload record when the node is finally saved. Cue validation error on subsequent edits, because the uploaded file isn't associated with the node.

I suspect there are other reported issues that are related to this problem, but couldn't say for sure. I think the user interface would benefit from being adjusted somehow; the current UI doesn't intuitively prompt users to click. It took a while before I even noticed the "select" button at all while investigating this particular client report.

alan d.’s picture

Similar issue with image only adverts - there is no magic select that I could see. The error is compounded by a double insert on the file object, throwing a duplicate file insertion warning on the second save after validation.

KG2’s picture

Version: 6.x-2.x-dev » 6.x-2.2

I am having the same problem when editing Image Ads: image needs to be re-uploaded before any edit or even node deletion can occur (version 6.x-2.2).

As heathergaye mention above it appears to occur when more than one ad type is enabled (in my case Image and HTML).

Her solution works:
Click the 'Select' button next to the 'Select Ad type' drop-down menu - in addition to selecting Image in the drop-down - when creating the image ad.

If this was not done on node creation the image will have to be re-uploaded on each edit (error message "It is required that you upload an image for your image advertisement") which means duplicate files in the file directory.

In my case I have had to re-upload existing images in order to delete the offending nodes.

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!