Jump to content

Images display on the front end before page is saved


thetuningspoon
 Share

Recommended Posts

I discovered an issue recently, which I haven't seen discussed before. I often use the API to output images directly from image fields without going through the WYSIWYG.

When I go to add an image in the admin, I discovered that this image is immediately displayed on the front end, even before I save the page. And if I decide not to save my changes, the image is still saved to the page!  

This almost burned me a couple times when I uploaded an image just as a demonstration and then later discovered that the image had actually gone up on the site!

Is this the intended behavior?

Link to comment
Share on other sites

That's because the image gets uploaded right after selecting the file (or using drag & drop).

If you don't want to save the page but still uploaded an image, you need to delete the image and save the page.

Link to comment
Share on other sites

Hi Wanze, that's what I figured. It doesn't seem like the ideal behavior, though. I don't know enough about how PW works, but it seems like the image should be able to be uploaded without the reference being there before saving. Although my guess is this wouldn't be a trivial thing to change.

Link to comment
Share on other sites

This is the nature of how the ajax uploading works, as it triggers a page save (though saving only the field you upload to). One way we could solve it is to add a status field to the file/image fieldtypes, giving them a way to identify a file as unpublished. Not sure how simple it will be to implement, but this is one of the things I've had on my list for awhile. If it comes up more often, I'll definitely bump it higher up the priority list. 

  • Like 12
Link to comment
Share on other sites

  • 6 months later...
  • 6 months later...

I'm currently trying out 2.5 and I notice that this issue hasn't been address. I just had a client upload a wrong image on their carousel and it immediately showed on the homepage. and they had to scramble to find a replacement image file. Since the field was setup to allow 1 image and it automatically delete the old one.
 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...