diff options
author | Andreas Gohr <gohr@cosmocode.de> | 2010-08-11 14:01:40 +0200 |
---|---|---|
committer | Andreas Gohr <gohr@cosmocode.de> | 2010-08-11 14:01:40 +0200 |
commit | d259f728f887b2ad76a2531705eac51b7dda8676 (patch) | |
tree | 599da1d8f2de89752a699f53872baf10fa1f581f | |
parent | 41c141178e9733bbf38f8e937d3dea63058af0dc (diff) | |
download | rpg-d259f728f887b2ad76a2531705eac51b7dda8676.tar.gz rpg-d259f728f887b2ad76a2531705eac51b7dda8676.tar.bz2 |
fixed locktimer/draft saving on new pages
When creating new pages, no date field is added in the edit form.
-rw-r--r-- | lib/exe/ajax.php | 2 | ||||
-rw-r--r-- | lib/scripts/edit.js | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php index 2945cca32..533b8f91c 100644 --- a/lib/exe/ajax.php +++ b/lib/exe/ajax.php @@ -139,7 +139,7 @@ function ajax_lock(){ 'prefix' => $_POST['prefix'], 'text' => $_POST['wikitext'], 'suffix' => $_POST['suffix'], - 'date' => $_POST['date'], + 'date' => (int) $_POST['date'], 'client' => $client, ); $cname = getCacheName($draft['client'].$id,'.draft'); diff --git a/lib/scripts/edit.js b/lib/scripts/edit.js index b507e804b..01262bcef 100644 --- a/lib/scripts/edit.js +++ b/lib/scripts/edit.js @@ -418,7 +418,9 @@ var locktimer = new locktimer_class(); params += '&prefix='+encodeURIComponent(dwform.elements.prefix.value); params += '&wikitext='+encodeURIComponent(dwform.elements.wikitext.value); params += '&suffix='+encodeURIComponent(dwform.elements.suffix.value); - params += '&date='+encodeURIComponent(dwform.elements.date.value); + if(dwform.elements.date){ + params += '&date='+encodeURIComponent(dwform.elements.date.value); + } } locktimer.sack.runAJAX(params); locktimer.lasttime = now; |