SMF 2.1 draft autosave not fuctioning

Started by oaqm, January 21, 2013, 01:27:57 PM

Previous topic - Next topic

oaqm

(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?

Suki

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.

oaqm


oaqm

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.

Suki

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.

emanuele

Quote from: oaqm on January 21, 2013, 02:42:22 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.

oaqm

Quote from: Suki 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.

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.

Matthew K.

// 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.

Suki

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:


', $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.

Arantor

If you're using jQuery in 2.1, perhaps something like this?

if ($('#check_sticky').prop('checked'))
  aSections.push('sticky=1');
if ($('#check_lock').prop('checked'))
  aSections.push('lock=1');

Matthew K.

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.

Road Rash Jr.

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.

emanuele



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.

Road Rash Jr.

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

FullyCreative

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

emanuele

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.

Illori

actually this issue should be solved in github so time to move it to fixed?

FullyCreative

Hi All,

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

Many Thanks :)

Arantor

This issue does not persist in 2.1. Moving to fixed.

Advertisement: