Not logged in. · Lost password · Register
Forum: General Help and Support Development RSS
the error "Cannot access protected property "
Avatar
hokkaidoperson #1
Member since Apr 2018 · 37 posts · Location: Sapporo, Hokkaido, Japan
Group memberships: Members
Show profile · Link to this post
Subject: the error "Cannot access protected property "
I want to use header2 plugin (https://github.com/danny0838/dokuwiki-plugin-header2 ), but this plugin leads the error, so I'm trying to solve it.

Firstly there was an error on line 51 "$handler->CallWriter = & new Doku_Handler_Nest($handler->CallWriter,'nest_close');" of syntax.php, but this error was solved by replacing "=&" with "=".
Another error is what is troubling me.
The error occurs when calling $renderer->node.
Here is the error code:

Fatal error: Uncaught Error: Cannot access protected property Doku_Renderer_xhtml::$node in /.../lib/plugins/header2/syntax.php:136 Stack trace: #0 /.../lib/plugins/header2/syntax.php(101): syntax_plugin_header2-
_xhtml_header('\xE3\x83\x97\xE3\x83\xAC\xE3\x83\x93\xE3\x83\xA5\xE3\x83\xBC', 1, 1, Object(Doku_Renderer_xhtml)) #1 /.../inc/parser/renderer.php(111): syntax_plugin_header2-
render('xhtml', Object(Doku_Renderer_xhtml), Array) #2 /.../inc/parserutils.php(654): Doku_Renderer-
plugin('header2', Array, 4, '======') #3 /.../inc/parserutils.php(130): p_render('xhtml', Array, NULL) #4 /.../inc/parserutils.php(105): p_cached_output('/...') #5 /... in /.../lib/plugins/header2/syntax.php on line 136

NOTE: I inserted the code "ini_set("display_errors", 1); error_reporting(E_ALL);" to the top of /header2/syntax.php . Line 136 corresponds to "$renderer->node[$level-1]++; ."


I'm not familiar with PHP, so I couldn't investigate more.
I'll inform you if more information is needed.
Avatar
turnermm (Moderator) #2
Member since Oct 2009 · 4399 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
This plugin looks quite out of date.  It's very probable that the plugin author is no longer active.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
hokkaidoperson #3
Member since Apr 2018 · 37 posts · Location: Sapporo, Hokkaido, Japan
Group memberships: Members
Show profile · Link to this post
Yes, it looks out of date, so I was trying to modify and use it.
Firstly I want to solve a problem when accessing $renderer->node .
Avatar
turnermm (Moderator) #4
Member since Oct 2009 · 4399 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
I looked at this and there's no way to access $node.  Until 4 years ago it was accessible, but when Dokuwiki's object oriented code was upgraded, $node was designated protected, meaning that it can only be accessed from inside its own class or from a class which extends its class.  There might be some clever coders who can workaround this, but I can't think of a way myself.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
hokkaidoperson #5
Member since Apr 2018 · 37 posts · Location: Sapporo, Hokkaido, Japan
Group memberships: Members
Show profile · Link to this post
I see.
I wish I could workaround this...
Avatar
hokkaidoperson #6
Member since Apr 2018 · 37 posts · Location: Sapporo, Hokkaido, Japan
Group memberships: Members
Show profile · Link to this post
I will consider modifying core DokuWiki programs to accomplish the purpose, but I'll also try to accomplish with a plugin.
Avatar
hokkaidoperson #7
Member since Apr 2018 · 37 posts · Location: Sapporo, Hokkaido, Japan
Group memberships: Members
Show profile · Link to this post
I tried to modify core DokuWiki programs, but I didn't do well, so I'll submit a demand to accomplish the purpose.
Avatar
hokkaidoperson #8
Member since Apr 2018 · 37 posts · Location: Sapporo, Hokkaido, Japan
Group memberships: Members
Show profile · Link to this post
I created a bounty related to this topic.
https://www.dokuwiki.org/bounties#add_a_configuration_that…
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: 2018-12-16, 14:22:42 (UTC +01:00)