dwp-forge / refnotes

4 stars 6 forks source link

'Failed to save configuration settings on the server' - message #15

Closed dwp-forge closed 9 years ago

dwp-forge commented 9 years ago
What steps will reproduce the problem?
1. Do install - both manual or trough admin page
2. try to change or save settings
3. message 'Failed to save configuration settings on the server' appears

What is the expected output? What do you see instead?

The 'communication status' changes from blue to grey to green and to grey again.. javascript
appears to be functional. Where does refnotes store its preferences? Is there some
file or directory that should be 777? 

What version of the product are you using? On what operating system?

I'm using dokuwiki version 2009-12-25c with the following plugins:

      Info Plugin 2008-09-12 by Andreas Gohr
      YouTube Plugin 2008-04-05 by Ikuo Obataya
      RefNotes Plugin 2010-04-05 by Mykola Ostrovskyy
      Math Plugin 2008-08-13 by Christopher Smith
      S5 Slideshow Plugin 2009-01-07 by Andreas Gohr
      SVG-Edit Plugin 2010-06-20 by Thomas Mudrunka
      Charter Plugin (syntax component) 2008-12-21 by Gina Haeussge
      Gallery Plugin 2010-04-30 by Andreas Gohr

Please provide any additional information below.

Original issue reported on code.google.com by edwin.dertien on 2010-09-20 13:45:46

dwp-forge commented 9 years ago
> Where does refnotes store its preferences? Is there some file or directory that should
be 777?

The settings are supposed to be saved in the plugin directory dokuwiki/lib/plugins/refnotes
in *.local.dat files. The directory doesn't have to be 777 but write access for http
server wouldn't harm.

From the bug report it seems that you are quite literate in software internals. There
are two places in admin.js where this warning is generated (look for saving_failed):
failure to send an AJAX request and invalid response from the server. Maybe with some
alert() calls you could figure out which one is triggered. That would be a start.

Original issue reported on code.google.com by dwp-forge on 2010-09-20 17:09:51

dwp-forge commented 9 years ago
Hi

I'm actually having the same problem as issues 20, 18 and 17 ; )
No way to load configuration files (.local.dat), no way to save them correctly (the
size of namespace.local.dat is 6 bytes).

I checked with an alert() in the file admin.js and it looks like it comes from the
ajax request.

Sorry for my bad english, and thanks for your help.

Original issue reported on code.google.com by gabriel.daudin on 2011-03-04 15:20:15

dwp-forge commented 9 years ago
> the size of namespace.local.dat is 6 bytes

And what are those 6 bytes? Anything readable? Isn't it 'a:0:{}' by chance?

Did you try to modify some settings? Could you for the sake of experiment delete all
*.local.dat files, go to the configuration page and save the settings without modifying
them?

> it looks like it comes from the ajax request

From which function? onSaved or saveSettings?

Original issue reported on code.google.com by dwp-forge on 2011-03-04 15:38:10

dwp-forge commented 9 years ago
>And what are those 6 bytes? Anything readable? Isn't it 'a:0:{}' by chance?
yes, this is an empty arry "a:0{}"

>Did you try to modify some settings? Could you for the sake of experiment delete all
*.local.dat files, go to the configuration page and save the settings without modifying
them?

I tried copying, renaming, deleting about 10 time. Always the same...

>From which function? onSaved or saveSettings?
the function is onSaved()

Original issue reported on code.google.com by gabriel.daudin on 2011-03-04 15:41:27

dwp-forge commented 9 years ago
Just adding something :

i can't set new configuration when using the configuration page. Hard to say it in
english, but imagine that no button react, except the "save" button.

Original issue reported on code.google.com by gabriel.daudin on 2011-03-04 15:43:42

dwp-forge commented 9 years ago
> no button react, except the "save" button.

I guess I can reproduce this by disabling server.loadSettings() call.

Could you put some alert() calls into loadSettings() and onLoaded() to see where they
go wrong?

Original issue reported on code.google.com by dwp-forge on 2011-03-04 16:25:51

dwp-forge commented 9 years ago
The problem is in the function onLoaded(), at line 
-> var settings = JSON.parse(ajax.response);

Original issue reported on code.google.com by gabriel.daudin on 2011-03-04 16:48:00

dwp-forge commented 9 years ago
That's weird : i went into the json2.js file and added some alert() into the function
json.parse. But no one appeared.
It looks like JSON object already exists, no ?

Original issue reported on code.google.com by gabriel.daudin on 2011-03-04 16:56:43

dwp-forge commented 9 years ago
Okay, i found the problem :
I made an alert(ajax.response") just before the line "var settings = JSON.parse(ajax.response);"
in the function onLoaded()

i got this :
-------------------------
{"cookie":"{B27067E9-3DDA-4E31-9768-E66F23D18F4A}","general":{"replace-footnotes":false,"reference-db-enable":false,"reference-db-namespace":":refnotes:"},"namespaces":[],"notes":[]}

<!-- www.000webhost.com Analytics Code -->

<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>

<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php"
alt="web hosting" /></a></noscript>

<!-- End Of Analytics Code -->
-----------------------------------------
It looks like my webhost added some code :p
i'm using webhost.com.

I deleted the "bad" text and launched successfully the script...
i think i can't disable this text. Maybe could you add a function which disable this
?

Hope this will help

Original issue reported on code.google.com by gabriel.daudin on 2011-03-04 17:15:08

dwp-forge commented 9 years ago
Could it be that you use some other plugin that includes another JSON instance?

You could try to rename JSON to something unique (say, JSONrn) in both admin.js and
json2.js and see what happens.

Original issue reported on code.google.com by dwp-forge on 2011-03-04 17:16:46

dwp-forge commented 9 years ago
> Okay, i found the problem

Great!

> It looks like my webhost added some code

It still doesn't explain why alert in json.parse didn't fire.

> Maybe could you add a function which disable this?

I'll try.

Original issue reported on code.google.com by dwp-forge on 2011-03-04 17:40:15

dwp-forge commented 9 years ago
Could you try this patch?

Original issue reported on code.google.com by dwp-forge on 2011-03-04 18:42:11


dwp-forge commented 9 years ago
How do you use a ".patch" file ?

Original issue reported on code.google.com by gabriel.daudin on 2011-03-07 08:03:50

dwp-forge commented 9 years ago
Sorry, I got an impression that you would know.

http://en.wikipedia.org/wiki/Patch_(computing)
http://en.wikipedia.org/wiki/Patch_(Unix)

Anyway, that patch was unnecessary complex. See the attachment.

Original issue reported on code.google.com by dwp-forge on 2011-03-07 08:31:49


dwp-forge commented 9 years ago
This is working fine :)
I see a print() in action.php, am i supposed to tell you what it says ? Where is it
printed ?

Original issue reported on code.google.com by gabriel.daudin on 2011-03-07 08:43:50

dwp-forge commented 9 years ago
This print() writes that message, which you receive in onLoaded() on JS side. You already
told me what it says using that alert(ajax.response) you did :)

Original issue reported on code.google.com by dwp-forge on 2011-03-07 09:07:40

dwp-forge commented 9 years ago
Okay, so I'll guess you do not need me anymore ?
Thanks for your help and reactivity : )

Original issue reported on code.google.com by gabriel.daudin on 2011-03-07 09:11:31

dwp-forge commented 9 years ago
Yep, I guess we fixed this one. Thanks for your help :)

Original issue reported on code.google.com by dwp-forge on 2011-03-07 09:17:26

dwp-forge commented 9 years ago
There was no follow-up for original issue, so let's assume it's a non-issue.

The issue with webhost JSON corruption is fixed in revision 401.

Original issue reported on code.google.com by dwp-forge on 2011-03-14 14:21:36