Advertisement:

Author Topic: SMF 2.1 draft autosave not fuctioning  (Read 13945 times)

Offline oaqm

  • Semi-Newbie
  • *
  • Posts: 34
SMF 2.1 draft autosave not fuctioning
« on: January 21, 2013, 01:27:57 PM »
(Moved here by request.....)

Under Members/Permissions/General Permissions I have "Save drafts of new posts" and "Automaticaly save drafts of new posts" (NOTE - "automaticaly" is misspelled, should be two L's) checked.
Under Configuration/Core Features I have Drafts activated, "Enable automatic saving of drafts" is checked and a value of 30 is entered for "How often should drafts be autosaved?"

I assume I have missed a step somewhere?

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,551
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: SMF 2.1 draft autosave not fuctioning
« Reply #1 on: January 21, 2013, 01:38:38 PM »
Can you please tell which browser(s) are you using.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline oaqm

  • Semi-Newbie
  • *
  • Posts: 34
Re: SMF 2.1 draft autosave not fuctioning
« Reply #2 on: January 21, 2013, 02:42:22 PM »
Sure, it's Seamonkey 2.15.

Offline oaqm

  • Semi-Newbie
  • *
  • Posts: 34
Re: SMF 2.1 draft autosave not fuctioning
« Reply #3 on: January 21, 2013, 04:21:07 PM »
Okay, some progress has been made on my end.

Under "Profile/Look and Layout" there is an "Enable automatic saving of drafts" option that I was unaware of. Once that was checked the autosave worked just fine in Seamonkey.

When testing using IE 8.0.7601.17514 I get the following:



The red X at the lower right hand corner of the attached image is the sm_loading.gif from the Themes/default/images directory. I don't know if the failure to load that image is triggering a failure in autosave or not, but at any rate the Error on Page notice comes up simultaneously in the lower left corner and the draft is not saved.

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,551
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: SMF 2.1 draft autosave not fuctioning
« Reply #4 on: January 21, 2013, 04:31:40 PM »
Well, it has been a while since last time I check 2.1's code but it seems more like a permission issue somewhere, I as an admin can autosave drafts in all browsers I checked this on, IE9, Opera and Firefox while as a regular user can't.

Firefox blames this line 107 on drafts.js:

if (document.getElementById('check_sticky').checked)

the "check_sticky" returns null somehow, I'm not familiar with any of the drafts code so I can't really offer a solution until I dig up a little more.

JavaScript is not my cup of tea, I assume by reading more of drafts.js that there must be some check for stickies and lock topics that gets fire up when it doesn't have to.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: SMF 2.1 draft autosave not fuctioning
« Reply #5 on: January 21, 2013, 05:12:04 PM »
Sure, it's Seamonkey 2.15.
WOW!
Another SeaMonkey user!! :D

ETA: sorry for the OT. :P


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline oaqm

  • Semi-Newbie
  • *
  • Posts: 34
Re: SMF 2.1 draft autosave not fuctioning
« Reply #6 on: January 21, 2013, 05:49:47 PM »
Well, it has been a while since last time I check 2.1's code but it seems more like a permission issue somewhere, I as an admin can autosave drafts in all browsers I checked this on, IE9, Opera and Firefox while as a regular user can't.

Same issue here. After I got it working in SeaMonkey as the admin, I decided to create a regular user account and no joy.

I have checked membergroup permissions and permissions by board, all are checked to allow autosave, but autosave is not working for the "regular" me, just the "admin" me.

@ emanuele, no problem. I got a bit leery of Firefox's 'New Version A Week' release schedule and went over to SeaMonkey. It reminds me of the good old Netscape days.

Offline Matthew K.

  • SMF Super Hero
  • *******
  • Posts: 12,430
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: SMF 2.1 draft autosave not fuctioning
« Reply #7 on: January 22, 2013, 01:27:41 AM »
Code: [Select]
// Get the locked an/or sticky values if they have been selected or set that is
if (this.opt.sType == 'post')
{
if (document.getElementById('check_lock').checked)
aSections[aSections.length] = 'lock=1';
if (document.getElementById('check_sticky').checked)
aSections[aSections.length] = 'sticky=1';
}
Both of those conditions should either be returning true or false, although I suppose we could verify that it wasn't null before checking for true false.

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,551
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: SMF 2.1 draft autosave not fuctioning
« Reply #8 on: January 22, 2013, 10:44:50 AM »
Well, it is checking if the radio/check box button is checked, if there is no radio button to check the it will indeed return null.

The bug is not on the JavaScript, drafts.js is only doing what was told it to do so, check for a radio button or a check box is indeed checked, if the radio button or the checkbox doesn't exists or has a different ID then drafts.js will act as its suppose to and return null.

In Post.template:

Code: [Select]
', $context['can_sticky'] ? '<li><input type="hidden" name="sticky" value="0" /><label for="check_sticky"><input type="checkbox" name="sticky" id="check_sticky"' . ($context['sticky'] ? ' checked="checked"' : '') . ' value="1" class="input_check" /> ' . $txt['sticky_after'] . '</label></li>' : '', '

$context['sticky'] is returning a vague or wrong value for regular users, same for $context['can_sticky']

I'm reticent to directly use the var to check for the var itself, unless you are absolutely sure that your var does exists, ie, you declared the var yourself, then don't directly use the var, use empty() or !empty()
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,665
    • StoryBB/StoryBB on GitHub
Re: SMF 2.1 draft autosave not fuctioning
« Reply #9 on: January 22, 2013, 01:13:48 PM »
If you're using jQuery in 2.1, perhaps something like this?

Code: [Select]
if ($('#check_sticky').prop('checked'))
  aSections.push('sticky=1');
if ($('#check_lock').prop('checked'))
  aSections.push('lock=1');
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Matthew K.

  • SMF Super Hero
  • *******
  • Posts: 12,430
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: SMF 2.1 draft autosave not fuctioning
« Reply #10 on: January 22, 2013, 02:58:55 PM »
Suki - Well right...checking to make sure it isn't null is basically validating this on the JavaScript side to avoid a possible error.

Spuds - Yeah, exactly.

Arantor - Thanks for the suggestion, appreciate it.

Offline Road Rash Jr.

  • Sr. Member
  • ****
  • Posts: 765
Autosave Draft
« Reply #11 on: February 04, 2013, 05:39:36 PM »
Autosave draft is not working, it is set to the default 30 seconds yet when you go to where it should be saved after the window is closed there is no draft.


Never argue with an Idiot like myself, they just drag you down to their level then beat you with experience.

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline Road Rash Jr.

  • Sr. Member
  • ****
  • Posts: 765
Re: Autosave Draft
« Reply #13 on: February 06, 2013, 10:44:11 PM »
Thank you :)
Never argue with an Idiot like myself, they just drag you down to their level then beat you with experience.

Offline FullyCreative

  • Semi-Newbie
  • *
  • Posts: 14
Re: SMF 2.1 draft autosave not fuctioning
« Reply #14 on: June 28, 2013, 10:57:40 AM »
Hi All,

I use the mod too but it says 'Error in Package Install'

   1.   Execute Modification   ./Sources/ManagePermissions.php   Test successful
   2.   Execute Modification   ./Sources/Subs-Members.php   Test successful
   3.   Execute Modification   ./Themes/default/GenericControls.template.php   Test successful
   4.   Execute Modification   ./Sources/Display.php   Test successful
   5.   Execute Modification   ./Themes/default/Display.template.php   Test successful
   6.   Execute Modification   ./Sources/ManagePosts.php   Test successful
   7.   Execute Modification   ./Sources/Post.php   Test failed
   1.   Add Before   ./Sources/Post.php   Test successful
   2.   Replace   ./Sources/Post.php   Test failed
   3.   Add Before   ./Sources/Post.php   Test successful
   4.   Add Before   ./Sources/Post.php   Test successful
   5.   Add Before   ./Sources/Post.php   Test successful
   8.   Execute Modification   ./Themes/default/Post.template.php   Test successful
   9.   Execute Modification   ./Sources/Profile.php   Test successful
   10.   Execute Modification   ./Sources/Profile-View.php   Test successful
   11.   Execute Modification   ./Themes/default/Profile.template.php   Test successful
   12.   Execute Modification   ./Themes/default/languages/Modifications.english.php   Test successful
13.   Execute Modification   ./Themes/default/languages/Modifications.english-utf8.php   Skipping file
14.   Execute Modification   ./Themes/default/languages/Modifications.english_british.php   Skipping file
15.   Execute Modification   ./Themes/default/languages/Modifications.english_british-utf8.php   Skipping file
16.   Extract File   ./Themes/default/scripts/draft_autosave.js   
17.   Adapt Database   install.php   

Any suggestions as to why it won't work please?

My Forum is www.webplusdesigner.com [nofollow]


Thank you, Charlie

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: SMF 2.1 draft autosave not fuctioning
« Reply #15 on: June 28, 2013, 11:08:08 AM »
FullyCreative welcome to sm.org.

This topic has nothing to do with mods, if you have problems with mod it's better to use the topic support for that specific mod (that you can find from the mod's page clicking on "Support and comments for this mod"). ;)


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,301
Re: SMF 2.1 draft autosave not fuctioning
« Reply #16 on: June 28, 2013, 11:55:10 AM »
actually this issue should be solved in github so time to move it to fixed?

Offline FullyCreative

  • Semi-Newbie
  • *
  • Posts: 14
Re: SMF 2.1 draft autosave not fuctioning
« Reply #17 on: June 28, 2013, 03:43:27 PM »
Hi All,

Thank you for posting so quickly.
I will investigate your suggestions.

Many Thanks :)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,665
    • StoryBB/StoryBB on GitHub
Re: SMF 2.1 draft autosave not fuctioning
« Reply #18 on: December 21, 2013, 01:24:59 PM »
This issue does not persist in 2.1. Moving to fixed.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.