Not logged in. · Lost password · Register
Forum: General Help and Support Installation and Configuration RSS
Dir Plugin not working with Hrun, with a possible solution
Avatar
mjd_tech #1
Member since Oct 2014 · 1 post
Group memberships: Members
Show profile · Link to this post
Subject: Dir Plugin not working with Hrun, with a possible solution
After upgrading from Ponder Stibbons to Hrun, I found that pages containing:
~~DIR~~
do not render.

If you use ~~DIR~~ in your sidebar.txt like I do, your whole site will not render.
I'm running php 5.5.9

I found the following error in the apache error log:
PHP Fatal error:  Cannot access protected property Doku_Renderer_xhtml::$_counter in /var/www/wiki/lib/plugins/dir/syntax.php on line 1061 ...

I traced the problem to the inc/parser/xhtml.php file.
In Ponder Stibbons,  $_counter was declared like this:
var $_counter   = array();
In Hrun, like this:
protected $_counter = array();

If I change it back to var, the pages render and it seems to fix the problem.
This is obviously not a good solution. You don't want to be hacking Dokuwiki core files.

So here is Plan B:
I changed the inc/parser/xhtml.php file back to original.
Next, I edited the lib/plugins/dir/syntax.php file,
at around line 59 I added this:
var $_counter = Array();

at around line 1061 I did this:
//$rdr->_counter['row_counter'] = 0;
$_counter['row_counter'] = 0;

This works too, at least for me it does.
I only use a very limited subset of what the Dir Plugin can do.

Your mileage may vary. I can't guarantee anything.
I'm not a php programmer. I can use grep and diff and perform crude hacks, that's about it.
I have a feeling the "real" solution has to do with how the Dir Plugin extends the core Dokuwiki classes, or something, but I get lost in all the "this class extends that class" stuff.

Hopefully, the maintainer of the Dir plugin will get a chance to fix the code for real.
In the meantime you can try this hack and see if it works for you.

Regards,
Mike D.
Avatar
turnermm (Moderator) #2
Member since Oct 2009 · 4812 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
This plugin has been adopted by lupo49.  You can report errors for it on github:
    https://github.com/lupo49/dokuwiki-plugin-dir/issues
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
gamma #3
Member since Sep 2006 · 123 posts · Location: Berlin
Group memberships: Members
Show profile · Link to this post
Problem seems to be that even lupo49 did not do a lot in the past ;) - I have not yet found a way to contact him :/
Avatar
turnermm (Moderator) #4
Member since Oct 2009 · 4812 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
lupo49 is a formum member. You can go to his member's page and send him an email:
     https://forum.dokuwiki.org/user/4072
That might get a quicker response.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
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: 2020-04-06, 04:52:38 (UTC +02:00)