Closed dwp-forge closed 9 years ago
(No text was entered with this change)
Original issue reported on code.google.com by dwp-forge
on 2009-08-26 06:03:29
The configuration is stored in the plugin directory (*.dat files).
Which browser do you use? What is the version of PHP?
Did it ever work on that server?
Can you access pre-defined namespaces from a page? For example, if you make reference
[(stars:>Some text)], does it show up as a star?
Original issue reported on code.google.com by dwp-forge
on 2009-08-26 06:18:49
Hi, just tried it to answer all your questions. So,
0) Yes, I figured it out about those .dat files: I have two of them for namespaces
and notes, so, I don't know where you store the boolean flag, whether I want to use
refnotes for footnotes (the first option on configure page).
1) I use FF3.5.2
2) php on server 5.2.6
3) I just installed it, so, it never worked for me, though the hosting is shared, so,
I have no idea about the others
4) [(stars:>Some text)] works, so it shows a little star instead of [(stars:>Some
text)], and at the bottom of page it shows "*)a Some text", I don't know, though why
there is this "a" with backreference, but I assume it is by design (I read the
documentation, but I did have chance to explore the plugin carefully due to this issue)
I figured it out that config page calls admin_refnotes.initialize, which creates the
layout (OK), and then calls server.loadSettings. This function first checks if ajax
is available (OK), then creates two vars call=refnotes-admin, action=load-settings
(I
have no idea about the meaning of these too), and then calls ajax.runAJAX. Before
that you assign ajax.onLoading=function, which set status. Here I don't get how it
works exactly, because it looks like you assign transaction="loading", then onLoading
calls setStatus(transaction, 'info'), and then setStatus checks for string value for
transaction, but in lang.php I don't see a string for 'loading', there is just one
for 'js_loading'. But I assume that somehow it gets this string. So, I DO see this
change, on the web page it says "Loading...", and then gets stuck.
I assume it is supposed to end up in afterCompletion, which is supposed to, first,
change the status on page (either indirectly by calling onCompletion == onLoaded, or
by explicitly setting error status), but this never happens...
Original issue reported on code.google.com by vadimcher
on 2009-08-26 17:52:01
Ok, to help you somehow I tried it in IE and Chrome:
Chrome ended up with pink "failed" message
IE didn't even show the message "Loading", so it does show it as a blue line about
the config options, but that "message" is empty, it has (!) on the left side, but
nothing else...
So, I think, if in the end we figure out that there is some problem with server, and
fix it somehow, there is still an issue that FF and IE do not show the problem clearly...
Original issue reported on code.google.com by vadimcher
on 2009-08-26 18:01:42
The "a" thing is okay. This is the backreference formating style. If you will have a
second reference to this note (i.e. [(stars:>Some text)][(stars:#1)]) it will render
as "*)a, b Some text".
The fact that you have access to the :stars: namespace clears the permissions story.
Obviously, PHP can access the configuration files.
So far I managed to get some weird behavior by trying to access the configuration
interface without admin rights. Though, on FF3.5.2 it says "success" and keeps the
UI
disabled, so it's not exactly as you describe. You do have admin rights, don't you?
If you are willing to play a guinea pig for a while, I could make a special build for
you with some extra logging to see what happens on the server side. Interested?
Original issue reported on code.google.com by dwp-forge
on 2009-08-26 18:31:27
>Obviously, PHP can access the configuration files.
Did you mean "can't"?
>You do have admin rights, don't you?
Yes, sure, otherwise, I think, I wouldn't get into the configuration page, right?
>I could make a special build for you with some extra logging
Ok, no problem. As long as it's safe and does not take too much with it ... :) It
would be better if it creates a log file with some kind of debug information, so,
maybe I will try to look at it...
Original issue reported on code.google.com by vadimcher
on 2009-08-26 19:33:37
>>Obviously, PHP can access the configuration files.
>Did you mean "can't"?
No, I really meant "can". Both AJAX serving and providing the pre-defined namespaces
for the page rendering use the same piece of code to access the configuration data.
If it works on the page it should also work for AJAX.
>Yes, sure, otherwise, I think, I wouldn't get into the configuration page, right?
Yes, you're right. I was cheating and didn't actually logout but merely changed the
AJAX handler to trigger "no admin rights" behavior.
As for the logging. Do you have access to PHP error log or config file?
Original issue reported on code.google.com by dwp-forge
on 2009-08-26 20:13:06
I have the exact same problem as described by above reporter, no odd entries in
apache's error log. I have a VPS running gentoo linux, so if there is anything I can
do assist as far as providing information please let me know.
Original issue reported on code.google.com by james
on 2009-08-26 20:26:10
Okay, here it comes.
The logging is added to both server and client sides. On the server side I use PHP
error_log() function, so you have to configure PHP to dump that into a file (look for
error_log in the config file). To minimize the noise please delete the log file prior
to entering the RefNotes configuration UI.
On the client side I abuse the note text area (scroll to the bottom) to log the
progress of the AJAX request.
In the archive I included the "healthy" log files if you are curious. Let's see what
your install does...
Original issue reported on code.google.com by dwp-forge
on 2009-08-26 21:31:51
I will download, install, and run your tests in a few hours. Thanks for making the
special build!
Original issue reported on code.google.com by james
on 2009-08-26 21:58:21
I did not find any php log files. Maybe James will help you with that. But I did test
it on configuration form in FF, Chrome and IE.
On the configuration form:
FF:
Sending data...
Data sent.
Chrome:
Completed.
URLString sent: call=refnotes-admin&action=load-settings
Status code: 0
Status message:
Response: ""
Handling data...
IE
(empty)
Original issue reported on code.google.com by vadimcher
on 2009-08-26 23:41:15
Give me a little while longer, I'm in the middle of a project at the moment. :)
Original issue reported on code.google.com by james
on 2009-08-26 23:46:53
The following appears in the page html on page load. (by viewing the html source).
Note that the "note section" contains no ajax output. I don't have php error logging
setup, but I am willing to do so if this information here is not enough.
<!-- no cachefile used, but created
/var/www/nixeagle/wiki/dokuwiki/data/cache/d/d4a1fc84e90c4002b97247e5609e666a.xhtml
-->
<!-- refnotes -->
<div id="refnotes-lang" style="display: none;">
status : Server comunication status.:eos:
loading : Loading configuration settings from the server...:eos:
loaded : Configuration settings are successfully loaded from the server.:eos:
loading_failed : Failed to load configuration settings from the server.:eos:
saving : Saving configuration settings on the server...:eos:
saved : Configuration settings are successfully saved on the server.:eos:
saving_failed : Failed to save configuration settings on the server.:eos:
invalid_ns_name : The specified namespace name is invalid.:eos:
ns_name_exists : The {1} namespace already exists.:eos:
delete_ns : Are you sure you want to delete {1} namespace?:eos:
invalid_note_name : The specified note name is invalid.:eos:
note_name_exists : The {1} note already exists.:eos:
delete_note : Are you sure you want to delete {1} note?:eos:
unsaved : Your changes to the configuration settings are not saved.:eos:
</div>
Original issue reported on code.google.com by james
on 2009-08-27 01:29:23
I think this is not what he asked: he added a textarea on config page (at the very
bottom), the log is supposed to output there something similar to what I posted (I
just copy-pasted it from there). In my case, though, all three browsers output
different stuff. What you posted, I think, is a hidden div with all messages.
Original issue reported on code.google.com by vadimcher
on 2009-08-27 01:35:08
But see, I get nothing in that bottom notes thing. I'm hoping that between the two of
us there is enough information here. :)
Original issue reported on code.google.com by james
on 2009-08-27 01:38:51
Ok, to be clear, the prior output I gave you is the php error output (Seems like the
VPS provider did not choose to log that to a file >.>, I'll fix that later as right
now its not an issue as the services on the server are Deny from all with a few Allow
from IP), when I reload the config form in firefox 3.5.2, I do get some ajax output
into that notes field:
Sending data...
Data sent.
That is it.
Original issue reported on code.google.com by james
on 2009-08-27 01:50:18
I tried to use Firebug, FF gets stuck at the moment it calls ajax.php with parameters
call=refnotes-admin&action=load-settings through xmlhttp.send() method. (I can't see
what happens there, as it is php code...)
Original issue reported on code.google.com by vadimcher
on 2009-08-27 01:54:03
Turning logging on, all I'm getting is:
[27-Aug-2009 02:37:58] > action.php
[27-Aug-2009 02:37:58] > register
[27-Aug-2009 02:37:58] < register
[27-Aug-2009 02:37:58] > action.php
[27-Aug-2009 02:37:58] > register
[27-Aug-2009 02:37:58] < register
[27-Aug-2009 02:37:58] > action.php
[27-Aug-2009 02:37:58] > register
[27-Aug-2009 02:37:58] < register
[27-Aug-2009 02:37:58] > action.php
[27-Aug-2009 02:37:58] > register
[27-Aug-2009 02:37:58] < register
[27-Aug-2009 02:37:58] > action.php
[27-Aug-2009 02:37:58] > register
[27-Aug-2009 02:37:58] < register
[27-Aug-2009 02:37:58] > action.php
[27-Aug-2009 02:37:58] > register
[27-Aug-2009 02:37:58] < register
Original issue reported on code.google.com by james
on 2009-08-27 02:44:05
I tried to get php log as well. So, what I did is the following:
I put logfile.php in refnotes folder
<?php
class Logging {
private $logfilename;
private $logfile = null;
function Logging($filename) {
$this->logfilename = $filename;
}
function create() {
$date = date('Ymd');
$time = date('H:i:s');
$this->logfile = fopen($this->logfilename . "_$date.log", 'a') or exit();
fwrite($this->logfile, "[$time]\n");
}
function write($logtext) {
$script = pathinfo(basename($_SERVER['PHP_SELF']), PATHINFO_FILENAME);
if ($this->logfile == null) create();
if (!$this->logfile) {
error_log("Logging->write(): failed to create log file $this->logfilename\n
Message received from $script: $logtext");
exit();
}
fwrite($this->logfile, "$script: $logtext\n");
}
}
$logging_ = null;
function error_log_($message) {
global $logging_;
if ($logging_ == null) {
error_log($message);
}
else {
$logging_->write($message);
}
}
?>
and also I added the following lines at the beginning of action.php:
require_once(DOKU_PLUGIN . 'refnotes/logfile.php');
$logging_ = new Logging(DOKU_PLUGIN . 'refnotes/log');
then I changed all lines containing error_log(...) to error_log_(...) in action.php,
but it does not seem to work. What might be wrong with this? At some point I did get
the result like this one:
[time]
> action.php
[time]
> action.php
[time]
> action.php
[time]
> action.php
[time]
> action.php
where [time] == [current time]
but then I changed something, and it did not produce even these lines. In fact, it
does not even create the log file. Please help: I just want to get local php log file
to post it here...
Original issue reported on code.google.com by vadimcher
on 2009-08-27 04:38:14
To get the php log file, you need to modify your php.ini. I think there are also ways
to tell the script to output errors as well but I'm not that well versed in php. As
far as modifying the .ini file though, its probably best that I point you at
http://www.washington.edu/computing/web/publishing/php-ini.html#log_errors
Original issue reported on code.google.com by james
on 2009-08-27 04:46:20
Guys, I really appreciate all the effort you put into this!
But honestly I still have no clue what's going on your systems. It appears that my
AJAX handler never gets a chance to run. So either I screwed-up with the request
formatting in the JS code or entire DokuWiki AJAX support is down.
Vadim, you mentioned that "ajax works throughout the rest of the site." What were you
talking about? When you do a search, does a little pop-up show up with a list of
suggestions?
That script that you use for logging looks okayish to me. Though, I would protect
creation of the global object against multiple inclusions of the file. Something
along the lines:
require_once(DOKU_PLUGIN . 'refnotes/logfile.php');
if ($logging_ == null) {
$logging_ = new Logging(DOKU_PLUGIN . 'refnotes/log');
}
Yet it would be safer if you could enable the built-in PHP logging.
The attached file contains modified ajax.php from /lib/exe/. This is the entry point
of all AJAX requests. If that doesn't show up in the log then it must be on JS side.
It also contains some rudimentary logging for that search feature that I mentioned.
Just to see if other AJAX requests are handled properly.
Original issue reported on code.google.com by dwp-forge
on 2009-08-27 06:52:32
with your modified ajax.php put in /lib/exe/ajax.php ... I get no changes to the
logs... yet things like page locking work correctly (I presume that is ajax related)
[27-Aug-2009 07:19:46] > action.php
[27-Aug-2009 07:19:46] > register
[27-Aug-2009 07:19:46] < register
[27-Aug-2009 07:19:46] > action.php
[27-Aug-2009 07:19:46] > register
[27-Aug-2009 07:19:46] < register
[27-Aug-2009 07:19:46] > action.php
[27-Aug-2009 07:19:46] > register
[27-Aug-2009 07:19:46] < register
[27-Aug-2009 07:19:46] > action.php
[27-Aug-2009 07:19:46] > register
[27-Aug-2009 07:19:46] < register
[27-Aug-2009 07:19:46] > action.php
[27-Aug-2009 07:19:46] > register
[27-Aug-2009 07:19:46] < register
Original issue reported on code.google.com by james
on 2009-08-27 07:25:16
Additionally I installed the readability plugin as it is one of the ones that use
ajax. Server logs from when I opened a page, previewed it, (no save) follow:
[27-Aug-2009 07:50:09] > action.php
[27-Aug-2009 07:50:09] > register
[27-Aug-2009 07:50:09] < register
[27-Aug-2009 07:51:31] > ajax.php
[27-Aug-2009 07:51:31] > action.php
[27-Aug-2009 07:51:31] > register
[27-Aug-2009 07:51:31] < register
[27-Aug-2009 07:51:31] ajax.php : call = lock
[27-Aug-2009 07:52:02] > ajax.php
[27-Aug-2009 07:52:02] > action.php
[27-Aug-2009 07:52:02] > register
[27-Aug-2009 07:52:02] < register
[27-Aug-2009 07:52:02] ajax.php : call = lock
Original issue reported on code.google.com by james
on 2009-08-27 07:54:15
Did you try to search for something? Just type a couple of letters into the search
box and wait a while. It should show a pop-up with a list of pages.
As for the locking, I'm not sure. There is indeed ajax_lock() function in the
ajax.php (BTW, you could add logging to that function as well), but I have an
impression that Andi doesn't trust vital functionality to JS as it might be disabled.
So I wouldn't be surprised if ajax_lock() is only used as an extra feature, while
there is also a brute-force mechanism in place that does not depend on JS (i.e.
refreshing the lock on every preview).
Original issue reported on code.google.com by dwp-forge
on 2009-08-27 08:03:58
Doing the search trick, it works just as it works on dokuwiki.org. PHP error log from
your modified ajax.php is as follows (for just that bit, eg I deleted it, typed
something, waited for ajax to pop up... etc)
[27-Aug-2009 08:06:46] > ajax.php
[27-Aug-2009 08:06:46] > action.php
[27-Aug-2009 08:06:46] > register
[27-Aug-2009 08:06:46] < register
[27-Aug-2009 08:06:46] ajax.php : call = qsearch
[27-Aug-2009 08:06:46] > ajax_qsearch
[27-Aug-2009 08:06:46] < ajax_qsearch
Original issue reported on code.google.com by james
on 2009-08-27 08:09:08
Okay, so it must be in my JS. I'll go through it once more to see if there is
something different from other AJAX requests.
Original issue reported on code.google.com by dwp-forge
on 2009-08-27 08:13:51
Good luck! I'm going to bed, its late... uh early here ;)
Original issue reported on code.google.com by james
on 2009-08-27 08:16:51
Thanks for tip. Now I got php log:
> action.php
> register
< register
Original issue reported on code.google.com by vadimcher
on 2009-08-27 16:28:43
I prepared one more piece of alien technology. This time it's logging from inside the
AJAX wrapper /lib/scripts/tw-sack.js. The log is added at the bottom of the top bar
of the default template (this is where the search box is).
The included log files are search for "test" and loading of the RefNotes settings.
As
you can see there are some minor differences but it's hard to believe that they cause
the problem.
Give it a spin, maybe it will shed some light into this mess...
Original issue reported on code.google.com by dwp-forge
on 2009-08-27 18:51:54
It just downed on me that I didn't ask the most important questions of them all:
Which version of DokuWiki are you guys running?
Which plugins do you have installed?
Original issue reported on code.google.com by dwp-forge
on 2009-08-27 19:11:39
I think it's february's wiki (the latest?)
Original issue reported on code.google.com by vadimcher
on 2009-08-27 19:14:14
> I think it's february's wiki (the latest?)
It's in the /dokuwiki/version file. Just to be sure.
And what about the plugins?
Original issue reported on code.google.com by dwp-forge
on 2009-08-27 19:42:06
2009-02-14b
Original issue reported on code.google.com by vadimcher
on 2009-08-27 19:44:07
Thanks. Pity, I had some hopes for this one.
Original issue reported on code.google.com by dwp-forge
on 2009-08-27 19:51:16
On which server do you run DokuWiki (i.e. Apache, IIS, etc.)?
Do you use URL rewriting (http://www.dokuwiki.org/rewrite)?
Original issue reported on code.google.com by dwp-forge
on 2009-08-27 22:01:23
SERVER_SOFTWARE Apache/1.3.33
Original issue reported on code.google.com by vadimcher
on 2009-08-27 22:09:33
Yes, rewrite=1. Use of slashes On.
Original issue reported on code.google.com by vadimcher
on 2009-08-27 22:11:16
It can't be... But on the other hand why not try...
There is a place in admin.js where new AJAX wrapper is created (line 206):
var server = (function () {
var ajax = new sack(DOKU_BASE + '/lib/exe/ajax.php');
var timer = null;
If you remove the slash in front of "lib":
var ajax = new sack(DOKU_BASE + 'lib/exe/ajax.php');
does anything change?
Original issue reported on code.google.com by dwp-forge
on 2009-08-27 22:20:01
Yes, it can be! And, in fact, it is!
Original issue reported on code.google.com by vadimcher
on 2009-08-27 22:28:05
There is some inconsistency: if you use something like $conf['metadir'] it does not
end with slash, but global variables for directories end with slash. Nice job, and
good guess, thanks! Would you update the version on DokuWiki plugin page today? Thanks.
Original issue reported on code.google.com by vadimcher
on 2009-08-27 22:33:07
That makes sense too, because my DOKU_BASE is different from the default. I'll test
the same change shortly myself
Original issue reported on code.google.com by james
on 2009-08-27 22:33:53
> Would you update the version on DokuWiki plugin page today?
I would like to get confirmation from James first.
Original issue reported on code.google.com by dwp-forge
on 2009-08-27 22:38:39
In the version you sent us I found two new files define_namespaces.php and
define_notes.php. Are they for future versions?
Original issue reported on code.google.com by vadimcher
on 2009-08-27 22:50:51
Confirmed, removing that slash lets the config page work correctly and the log is
full of ajax requests now! I have a feeling that because I set DOKU_BASE (eg
http://www.dokuwiki.org/config:basedir ) to "/", your expression then ended up sendng
//lib/exe/ajax.php which... of course does not exist :).
For completeness out of the note box I got:
Sending data...
Data sent.
Sending data...
Data sent.
Getting data...
Completed.
URLString sent: call=refnotes-admin&action=load-settings
Status code: 200
Status message: OK
Response:
"{"general":[],"namespaces":{":":[],":biblio:":{"refnote-id":"note-name","reference-base":"normal-text","reference-format":"brackets","multi-ref-id":"note-counter","note-preview":"tooltip","note-id-base":"normal-text","note-id-font-weight":"normal","note-id-font-style":"normal","note-id-format":"none","back-ref-caret":"prefix","back-ref-format":"latin"},":cite:":{"reference-format":"brackets","multi-ref-id":"note-counter","note-id-format":"dot","back-ref-format":"latin"},":dw:":{"refnote-id":"numeric","reference-base":"super","reference-font-weight":"normal","reference-font-style":"normal","reference-format":"right-parent","multi-ref-id":"ref-counter","note-preview":"popup","notes-separator":"100%","note-font-size":"normal","note-id-base":"super","note-id-font-weight":"normal","note-id-font-style":"normal","note-id-format":"right-parent","back-ref-caret":"none","back-ref-base":"super","back-ref-font-weight":"bold","back-ref-font-style":"normal","back-ref-format":"note-id","back-ref-separator":"comma","scoping":"reset"},":fn:":[],":mw:":{"refnote-id":"numeric","reference-base":"super","reference-font-weight":"normal","reference-font-style":"normal","reference-format":"brackets","multi-ref-id":"note-counter","note-preview":"none","notes-separator":"none","note-font-size":"normal","note-id-base":"normal-text","note-id-font-weight":"normal","note-id-font-style":"normal","note-id-format":"dot","back-ref-caret":"merge","back-ref-base":"super","back-ref-font-weight":"bold","back-ref-font-style":"italic","back-ref-format":"latin","back-ref-separator":"none","scoping":"reset"},":stars:":{"refnote-id":"stars","reference-format":"none","multi-ref-id":"note-counter","note-preview":"tooltip","back-ref-format":"latin"},":table:":{"multi-ref-id":"note-counter","note-preview":"tooltip","notes-separator":"none","back-ref-format":"none"},":table:alpha:":{"refnote-id":"latin-lower"},":table:stars:":{"refnote-id":"stars","reference-format":"none"}},"notes":{":todo":{"text":"%%[%%\/\/[[:missing_citation|citation
needed]]\/\/%%]%%","inline":true},":cite:todo":{"text":"%%[%%\/\/[[:missing_citation|citation
needed]]\/\/%%]%%","inline":true},":ref:todo":{"text":"%%[%%\/\/[[:missing_reference|reference
needed]]\/\/%%]%%","inline":true}}}"
Handling data...
Original issue reported on code.google.com by james
on 2009-08-27 22:55:50
Sorry I was not around to answer your version question, the dokuwiki I initially
encountered the problem on was a snapshot: 2009-08-26, however before noting the
issue here I checked with the latest February release (2009-02-14b) and I have been
doing all my debugging on the release version. Note though that your fix moved over
to the snapshot works too. So you are future proof so far :)
Thanks for the work you put in to quickly fix this.
Original issue reported on code.google.com by james
on 2009-08-27 23:08:05
Confirmed, I just used firebug: when ajax is called through xmlhttp.send sack object
has requestFile="//lib/exe/ajax.php".
Original issue reported on code.google.com by vadimcher
on 2009-08-27 23:09:06
James said: "Thanks for the work you put in to quickly fix this."
In fact, it is the fastest response and the most attention to the bug I saw in
recent... many years... Great!
Original issue reported on code.google.com by vadimcher
on 2009-08-27 23:12:46
About comment 46: I forgot to say that I also have Base="/"... Also, please answer on
Comment 43.
Original issue reported on code.google.com by vadimcher
on 2009-08-27 23:14:25
Apparently we have quite some time zones between us -- most activity on this page
happens while I sleep :)
> In the version you sent us I found two new files define_namespaces.php and
> define_notes.php. Are they for future versions?
No. This are the scripts I use to generate default configuration files.
> ended up sendng //lib/exe/ajax.php which... of course does not exist
Well, partly because of this, all clever applications ignore multiple slashes and
treat them as one. Yet smarter ones ignore "/./" as well. Semantically "/foo/bar" and
"/foo/////////bar" point to the same location. And Apache is totally okay with this.
Though on that rewriting page I saw that they match paths with "/" instead of "/+".
While, at the first glance, there are no rules for ajax.php in Apache configuration,
there are certainly some rules in IIS configuration that will cause the problem.
Thank you guys for helping me with this one! I will look into that inconsistent error
reporting and probably will make a new release during this weekend.
Original issue reported on code.google.com by dwp-forge
on 2009-08-28 06:15:53
Fixed in revision 240.
Original issue reported on code.google.com by dwp-forge
on 2009-08-28 06:23:01
Original issue reported on code.google.com by
vadimcher
on 2009-08-25 22:46:30