indexmenu
indexmenu copied to clipboard
Tree new - unable to browse the tree structure without page loading
Hi, I tried the treenew option and immediate reaction was that I am unable to browse the indexmenu tree without the page being reloaded every time I click to expand. In the previous version I was able to expand to n-th level of the namespaces and then click the name to open the page... is it gone or I am doing something wrong?
Do you have a picture of such a tree? The name of node become clickable if a namespace has a headpage associated (adjustable via config of plugin), might be that a difference is that the folder/page icon is now clickable as well (I do not know exactly if that was changed). The expander before the icon must only open and close, it should not load the page.
I can consider if an icon must load or not, eventually trying to make it consistent between old and new tree..
Hi, definitely in old version icon did not load the page. In the new version it does nothing I think. I used a default template for a test.
Sure you see the new tree, and not the nojs tree? I do not yet understand the situation.
What happens if you click on:
about namespace nodes:
- does namespace node have all a link to a headpage in your case (therefore I asked a image)
- does the name with link load a new page?
- does the name without link load a page?
- does clicking an icon load a page?
- does clicking an expander(+/- symbol) load a page?
about page node:
- does clicking name/url load a page?
- does clicking an icon load a page?
- does clicking an expander load a page?
Are there any errors in the Console of your browser?
I have recorded the video showing how it works, one for treenew and the other without treenew. I suspect this could have something to do with the skins. As you can see, without the skin defined, it works ok. When I define a skin, then it is extremely hard to click to expand. It is only possible when I precisely hit the middle of the marker.
https://drive.google.com/drive/folders/1ByYl17pqtwHLNQjY_y6M-doE3fE6am-d?usp=drive_link Hope that helps to understand.
Thanks for the movies. That helps a lot.
#doku2 exists only as 'theme' for the js treeold. The js treenew has that one not available as 'skin'. I should do two separate checks: if it is treeold, check if the theme-name exists as 'theme', or if it is treenew that it exists as 'skin'. Now these approaches are mixed, such that it find a hit for treeold, but most of these does not exist for treenew. Next it try to show the not existing 'doku2'-skin for treenew. But because it does not exist, you see a bare tree, that looks even a kind of decent, but works rather bad because it misses a lot of relevant css code.
At certain point you see a syntax error on a node. I guess that is a separate issue than the layouting issue. Could you open the network tab of the Developer tool, reload the page, and navigate to this point in the tree again. If that error occurs, could you check what is returned as Response by the ajax.php call? I guess it returns something that starts different than default. e.g. it starts with an error text or something like that..
Hi @Klap-in , sorry for the delay. This is the response.
<!DOCTYPE html>
<html>
<head><title>TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class Doku_Renderer_metadata does not have a method "table_align"</title></head>
<body style="font-family: Arial, sans-serif">
<div style="width:60%; margin: auto; background-color: #fcc;
border: 1px solid #faa; padding: 0.5em 1em;">
<h1 style="font-size: 120%">TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class Doku_Renderer_metadata does not have a method "table_align"</h1>
<p>An unforeseen error has occured. This is most likely a bug somewhere. It might be a problem in the indexmenu plugin.</p>
<p>More info has been written to the DokuWiki error log.</p>
</div>
</body>
</html>
Here is the full log
2024-02-28 18:39:22
TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class Doku_Renderer_metadata does not have a method "table_align"
C:\Users\someone\Downloads\Dokuwiki\Wiki\dokuwiki\inc\parserutils.php(535)
#0 C:\Users\someone\Downloads\Dokuwiki\Wiki\dokuwiki\inc\parserutils.php(299): p_render_metadata('en:admin-guides...', Array)
#1 C:\Users\someone\Downloads\Dokuwiki\Wiki\dokuwiki\lib\plugins\indexmenu\Search.php(812): p_get_metadata('en:admin-guides...', 'indexmenu_n')
#2 C:\Users\someone\Downloads\Dokuwiki\Wiki\dokuwiki\lib\plugins\indexmenu\Search.php(608): dokuwiki\plugin\indexmenu\Search->getSortValue(Array)
#3 [internal function]: dokuwiki\plugin\indexmenu\Search->searchIndexmenuItemsNew(Array, 'C:/Users/mradla...', '//en/admin-guid...', 'f', 6, Array)
#4 C:\Users\someone\Downloads\Dokuwiki\Wiki\dokuwiki\lib\plugins\indexmenu\Search.php(656): call_user_func_array(Array, Array)
#5 C:\Users\someone\Downloads\Dokuwiki\Wiki\dokuwiki\lib\plugins\indexmenu\Search.php(681): dokuwiki\plugin\indexmenu\Search->customSearch(Array, 'C:/Users/mradla...', Array, Array, '//en/admin-guid...', 6)
#6 C:\Users\someone\Downloads\Dokuwiki\Wiki\dokuwiki\lib\plugins\indexmenu\Search.php(681): dokuwiki\plugin\indexmenu\Search->customSearch(Array, 'C:/Users/mradla...', Array, Array, '//en/admin-guid...', 5)
#7 C:\Users\someone\Downloads\Dokuwiki\Wiki\dokuwiki\lib\plugins\indexmenu\Search.php(681): dokuwiki\plugin\indexmenu\Search->customSearch(Array, 'C:/Users/mradla...', Array, Array, '//en/admin-guid...', 4)
#8 C:\Users\someone\Downloads\Dokuwiki\Wiki\dokuwiki\lib\plugins\indexmenu\Search.php(681): dokuwiki\plugin\indexmenu\Search->customSearch(Array, 'C:/Users/mradla...', Array, Array, '//en/admin-guid...', 3)
#9 C:\Users\someone\Downloads\Dokuwiki\Wiki\dokuwiki\lib\plugins\indexmenu\Search.php(681): dokuwiki\plugin\indexmenu\Search->customSearch(Array, 'C:/Users/mradla...', Array, Array, '//en/release_no...', 2)
#10 C:\Users\someone\Downloads\Dokuwiki\Wiki\dokuwiki\lib\plugins\indexmenu\Search.php(240): dokuwiki\plugin\indexmenu\Search->customSearch(Array, 'C:/Users/mradla...', Array, Array, '//wiki')
#11 C:\Users\someone\Downloads\Dokuwiki\Wiki\dokuwiki\lib\plugins\indexmenu\action.php(299): dokuwiki\plugin\indexmenu\Search->search('', Array)
#12 C:\Users\someone\Downloads\Dokuwiki\Wiki\dokuwiki\lib\plugins\indexmenu\action.php(201): action_plugin_indexmenu->getDataFancyTree()
#13 C:\Users\someone\Downloads\Dokuwiki\Wiki\dokuwiki\inc\Extension\EventHandler.php(80): action_plugin_indexmenu->ajaxCalls(Object(dokuwiki\Extension\Event), NULL)
#14 C:\Users\someone\Downloads\Dokuwiki\Wiki\dokuwiki\inc\Extension\Event.php(75): dokuwiki\Extension\EventHandler->process_event(Object(dokuwiki\Extension\Event), 'BEFORE')
#15 C:\Users\someone\Downloads\Dokuwiki\Wiki\dokuwiki\inc\Ajax.php(31): dokuwiki\Extension\Event->advise_before()
#16 C:\Users\someone\Downloads\Dokuwiki\Wiki\dokuwiki\lib\exe\ajax.php(26): dokuwiki\Ajax->__construct('indexmenu')
#17 {main}
I think this does not play well with this plugin: https://github.com/ConX/dokuwiki-plugin-prettytables/
And as for
#doku2 exists only as 'theme' for the js treeold. The js treenew has that one not available as 'skin'. I should do two separate checks: if it is treeold, check if the theme-name exists as 'theme', or if it is treenew that it exists as 'skin'. Now these approaches are mixed, such that it find a hit for treeold, but most of these does not exist for treenew. Next it try to show the not existing 'doku2'-skin for treenew. But because it does not exist, you see a bare tree, that looks even a kind of decent, but works rather bad because it misses a lot of relevant css code.
Should I do anything? I followed the docs to put the icons into the images folder. Not sure if there should a new folder named skins? When I check in admin panel index menu utils, I see no templates there :/
call_user_func_array(): Argument #1 ($callback) must be a valid callback, class Doku_Renderer_metadata does not have a method "table_align"
this is an issue, for which a hotfix release of DokuWiki is released. I guess you have not yet installed that hotfix release?
if you use the treenew
, then theme doku2
cannot be used. It is only for the old js tree.
If you created a new skin yourself for the new tree (that is not yet documented), then you need to create less files as well.
Thanks @Klap-in , Yes indeed, the problem was with missing hotfix. I realized that while having other bug. As for the skin...I am then looking forward for documentation on how to create a new skin for treenew. Thanks for help! Marcin