ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Safecracker - browser back will enable new entry

May 12, 2011 5:43am

Subscribe [3]
  • #1 / May 12, 2011 5:43am

    spotd

    16 posts

    I am very impressed with SafeCracker and have it working for an awards entry site.

    I have set this up so that it always uses an url_title, and works as you expect. The url_title is taken from segment_4. If the entry doesn’t exist it makes it, and from then on it simply edits. Exactly as i want. BUT, i have started to notice some repeat entries (same url_title with one added digit).

    I have replicated this by after submitting the entry for the fist time (ie making the new entry) if you click browser back rather than the buttons on the website that cause the pages to reload, then click save again it will create a new entry rather than edit the one with that url_title. I assume because it is simply going back in the cache, it keeps some hidden inputs in the form instructing to make a new entry? Obviously reloading the page fixes this, though I need to make this water tight.

    Are there any checks i can do on submission to see if the entry exists?

    Thanks

    Mark

  • #2 / May 12, 2011 6:35pm

    Sue Crocker

    26054 posts

    Hi, Mark.

    Quick question for you.. do you have a return= setting, and are you using Secure forms? It very possibly could be a bug, but a sample template I could test this with would be helpful.

  • #3 / May 12, 2011 6:59pm

    spotd

    16 posts

    Hi Sue,

    Sure here is the header -

    {exp:safecracker channel="entries" return="profile/index" author_only="yes" url_title="{segment_4}" include_jquery="no" safecracker_head="no" rules:contact_email="valid_email"}

    There is one unconventional thing I am doing, which is setting the return and return_url with jquery before submitting the form. as below -

    function sendForm(goto){
     
       $('input[name="return"]').val('profile/'+goto);
       $('input[name="return_url"]').val('profile/'+goto);
            
       document.getElementById('publishForm').submit();
    
     
    };

    As the member has option to ‘save and continue’ or ‘save and previous’, Though not sure this is the cause.

  • #4 / May 13, 2011 2:55pm

    Sue Crocker

    26054 posts

    Posted as a bug.

  • #5 / Oct 14, 2011 4:59am

    jcowen

    66 posts

    Is there any update on this because I’ve just discovered the same problem?

    Thanks

  • #6 / Oct 14, 2011 7:00am

    Sue Crocker

    26054 posts

    Hi, John. Not yet. It is listed as confirmed, though.

  • #7 / Jan 04, 2012 11:49am

    spotd

    16 posts

    I have found a hack for this -

    http://my.opera.com/rb79/blog/2008/03/22/force-reload-refresh-when-pressing-the-back-button

    Seems to do the trick for me… Still an EE solution would be better.

    M

  • #8 / Jan 05, 2012 3:52pm

    Dan Decker

    7338 posts

    Hi scrotd,

    Thanks for sharing your resource on a solution. Keep an eye on the bug report for any progress towards an ExpressionEngine based solution. Is there anything else we can assist you with?

    Cheers!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases