Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doku_Handler::addCall() is not accessible from plugins #2887

Closed
ssahara opened this issue Oct 18, 2019 · 1 comment
Closed

Doku_Handler::addCall() is not accessible from plugins #2887

ssahara opened this issue Oct 18, 2019 · 1 comment
Assignees

Comments

@ssahara
Copy link
Collaborator

ssahara commented Oct 18, 2019

https://github.com/splitbrain/dokuwiki/blob/3623073f5adbca901ac0c77e239a84413a9ed10a/inc/parser/handler.php#L47

addCall() corresponds to former _addCall(). The method visibility has altered to "protected", and now it is not accessible anymore from syntax plugin class.

Some third-party syntax plugins eg. wrap plugin uses _addCall(), and the relevant plugin developers will need to modify their codes so that it will work both with current stable DokuWiki and the Snapshot versions.

It seems that syntax plugins can add any type of call/instruction directly to Doku_Handler::calls array in its handle() method. For example,

   $handler->_addCall('header', [$title,$level,$pos], $pos);

can be rewritten as

      $handler->calls[] = array('header', [$title,$level,$pos], $pos);

I wonder whether this is a practical approach to make one plugin code work well both with "Greebo" and the Snapshot versions?

@splitbrain
Copy link
Collaborator

Well spotted. That's exactly the feedback we need.

I think adding calls is reasonable for plugins so we should make this call public again and have a deprecated tagged legacy method for a while.

@splitbrain splitbrain added this to Triage in PSR-2 Finishing via automation Oct 18, 2019
@splitbrain splitbrain self-assigned this Oct 18, 2019
PSR-2 Finishing automation moved this from Triage to Done Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants