Not logged in. · Lost password · Register
Forum: General Help and Support Plugins RSS
Go diagrams plugin help needed
Help needed to visualize images from the cache
Avatar
cleinias #1
Member for 3 months · 6 posts
Group memberships: Members
Show profile · Link to this post
Subject: Go diagrams plugin help needed
Problem:
I am new to dokuwiki and I am trying to set up a site that will include diagrams for the game Go. I installed the relevant plugin https://www.dokuwiki.org/plugin:godiag?s[]=weiqi (a port to Dokuwiki of the mediaWiki extension) but the diagrams it produces are not visualized in the pages unless I hardcode the inc directory into the plugin.

In detail:

1. The plugin provides an extension to Dokuwiki's markup that allows the user to insert an ascii rendition of a go board between <go> </go> tags

2. The plugin then produces two files, a PNG image of the produced board and a textual representation of it in the standard SGF format

3. When saved, the produced dokuwiki page will show the png diagram with a link to the SGF file for download

My problem is at stage 3. Both the png and the SGF are produced. I can retrieve them from the cache from the command line. But they don't show up in the page.
Looking at the webserver log reveals that the fetch.php file of godiag fails because it looks for some of Dokuwiki php modules e.g. init.php, common.php, and pageutils.php) in the wrong place. In my installation (Archlinux)  they are in /usr/share/webapps/dokuwiki/ whereas the plugin looks for them in the directory three levels up from the plugin's own, which results in /var/lib/.

If I manually change the address and hard code it in fetch.php, the plugin works again. But that seems definitely not a very robust way to proceed.

What's the better way? Is there a global variable set somewhere that defines docuwiki's root dir?
Avatar
schplurtz (Moderator) #2
Member since Nov 2009 · 398 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
It seems you followed instructions on https://wiki.archlinux.org/index.php/DokuWiki and used pacman to install. In this case,
Quote by archlinux doc:
The package in [community] unpacks DokuWiki at /usr/share/webapps/dokuwiki with the configuration files in /etc/webapps/dokuwiki and the data files in /var/lib/dokuwiki/data


Quote by cleinias:
In my installation (Archlinux)  they are in /usr/share/webapps/dokuwiki/ whereas the plugin looks for them in the directory three levels up from the plugin's own, which results in /var/lib/.
If I understand you correctly, the plugin is installed in /var/lib/dokuwiki/data/godiag, o_O. Did the extension manager installed it there or did you try some sort of manual installation ? It should be in /usr/share/webapps/dokuwiki/lib/plugins/godiag. three levels up form there is the right dir.

Just to be sure, can you post the result of this command ?
ls -l /var/lib/dokuwiki/data /usr/share/webapps/dokuwiki /usr/share/webapps/dokuwiki/lib/plugins
Avatar
cleinias #3
Member for 3 months · 6 posts
Group memberships: Members
Show profile · Link to this post
As you guessed, I did install Dokuwiki via pacman, and I did install the godiag plugin through the extension manager inside Dokuwiki. No manual installations.

The godiag plugin got installed in /var/lib/dokuwiki/plugins/godiag:

$ locate godiag
/var/lib/dokuwiki/plugins/godiag
/var/lib/dokuwiki/plugins/godiag/README
/var/lib/dokuwiki/plugins/godiag/Vera.ttf
/var/lib/dokuwiki/plugins/godiag/fetch.php
....etc...


Here is the dir structure you asked for:

$ ls -l /var/lib/dokuwiki/data /usr/share/webapps/dokuwiki /usr/share/webapps/dokuwiki/lib/plugins


lrwxrwxrwx  1 root root   42 Jan  9 12:10 /usr/share/webapps/dokuwiki/lib/plugins -> ../../../../../../var/lib/dokuwiki/plugins

/usr/share/webapps/dokuwiki:
total 92
drwxr-xr-x  2 root root  4096 Jan 22 14:41 bin
lrwxrwxrwx  1 root root    35 Jan  9 12:10 conf -> ../../../../../etc/webapps/dokuwiki
-rw-r--r--  1 root root 18092 Jan  9 12:10 COPYING
lrwxrwxrwx  1 root root    36 Jan  9 12:10 data -> ../../../../../var/lib/dokuwiki/data
-rw-r--r--  1 root root  3547 Jan  9 12:10 doku.php
-rw-r--r--  1 root root 19141 Jan  9 12:10 feed.php
drwxr-xr-x  8 root root  4096 Jan 22 14:41 inc
-rw-r--r--  1 root root  2097 Jan  9 12:10 index.php
-rw-r--r--  1 root root 19233 Jan  9 12:10 install.php
drwxr-xr-x  6 root root  4096 Jan 22 14:41 lib
-rw-r--r--  1 root root   306 Jan  9 12:10 README
drwxr-xr-x 11 root root  4096 Jan 22 14:41 vendor
-rw-r--r--  1 root root    21 Jan  9 12:10 VERSION

/var/lib/dokuwiki/data:
total 84
drwxr-xr-x  4 http http  4096 Jan 23 15:52 attic
drwxr-xr-x 18 http http  4096 Jan 22 17:15 cache
-rw-r--r--  1 http http     0 Jan  9 12:10 changes.log
-rw-r--r--  1 http http 19724 Jan  9 12:10 deleted.files
-rw-r--r--  1 http http  6516 Jan  9 12:10 dont-panic-if-you-see-this-in-your-logs-it-means-your-directory-permissions-are-correct.png
-rw-r--r--  1 http http 12093 Jan  9 12:10 dont-panic-if-you-see-this-in-your-logs-it-means-your-directory-permissions-are-correct.xcf
-rw-r--r--  1 http http    32 Jan  9 12:10 _dummy
drwxr-xr-x  2 http http  4096 Jan 23 16:44 index
drwxr-xr-x  2 http http  4096 Jan 23 18:10 locks
drwxr-xr-x  3 http http  4096 Jan 22 14:41 media
drwxr-xr-x  2 http http  4096 Jan 22 14:41 media_attic
drwxr-xr-x  2 http http  4096 Jan 22 14:41 media_meta
drwxr-xr-x  5 http http  4096 Jan 23 14:57 meta
drwxr-xr-x  5 http http  4096 Jan 23 14:57 pages
drwxr-xr-x  2 http http  4096 Jan 23 15:09 tmp
Avatar
schplurtz (Moderator) #4
Member since Nov 2009 · 398 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
I see. The "problem" comes from this link :
/usr/share/webapps/dokuwiki/lib/plugins -> ../../../../../../var/lib/dokuwiki/plugins
I think this is not how DokuWiki is supposed to be installed. I've never seen that before. Plugins should really be in /usr/share/webapps/dokuwiki/lib/plugins with the rest of DokuWiki.

For most plugins, this not a problem, because dokuwiki is already loaded and DOKU_INC is already defined as /usr/share/webapps/dokuwiki. When needed, theses plugins use DOKU_INC/lib/plugins/foo/bar (which in this case is/usr/share/webapps/dokuwiki/plugins/foo/bar), the symlink does its job, and everything is ok.

What's the better way? Is there a global variable set somewhere that defines docuwiki's root dir?
godiag/fetch.php is called directly, (
<img class="godiagimg" src="/lib/plugins/godiag/fetch.php?f=fcdb5d6c5589e00fbd979ba137d958a7&amp;t=png" alt="go diagram">
), without DW beeing loaded (and DOKU_INC set). So it has to guess. Because of the symlink however, its guess is wrong and it ends up wirh /var/lib instead of /usr/share/webapps/dokuwiki.

So, no variable defined that can be used. I'm afraid you have no choice but manually modify godiag/fetch.php and do what you already have done, define DOKU_INC as /usr/share/webapps/dokuwiki

Of course, this is a bug a should be reported. I think it is a pacman bug. If @andi (DW lead dev) happens to read this thread, he would probably confirm that this not to be considered a godiag bug.
Avatar
cleinias #5
Member for 3 months · 6 posts
Group memberships: Members
Show profile · Link to this post
So it looks like it is a bug in Archlinux's PKGBUILD file, which contains the following lines:

  # move plugins in var
  mv usr/share/webapps/dokuwiki/lib/plugins var/lib/dokuwiki
  ln -s {../../../../../../var/lib/dokuwiki,usr/share/webapps/dokuwiki/lib}/plugins


I will report it to the maintainer and refer him to this discussion
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-04-26, 00:06:27 (UTC +02:00)