Closed tomio13 closed 2 years ago
please provide a proper pull request with a unit test; I'm not at home in this inherited and convoluted codebase.
this may be an API change in DW, making your suggested fix break with the current release candidate.
As you can see there is no function html_wikilink
that takes a boolean as the second argument: https://xref.dokuwiki.org/reference/dokuwiki/inc/html.php.source.html#l34
I am sorry, you lost me here...
(It was a post 5 months ago.)
In the file PageQuery.php on line 974 the plugin defines $display as boolean. If you change that to string and call the html_wikilink() as html_wikilink($id, $display) (as the commented out line in line 982), the code is fixed.
Using $display as text, it gets sent as a $title to $xhtml_renderer->internallink($id,$name,$search,true,'navigation');
I've created https://github.com/mprins/pagequery/pull/11 with your suggested fix
Thank you!
environment
expected behaviour
{{pagequery> ^equipment:large_scale; fullregex; display=title; }} Expected to display the first header of each pages.
actual behaviour
It displays the dokuwiki page names, independent of what I do to display.
steps to reproduce actual behaviour
Just try setting display to title.
error log
No error displayed.
suggested solution
In PageQuery.php, in function htmlwikilink, replace:
bool $display to string $disaplay in line 974, and use the original form 983 (currently commented out) instead of 947, that is: $link = html_wikilink($id, $display);
in PageQuery.php:
Then it works properly (at least for using title).