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
Menu: loading page for a custom plugin's menu triggers javascript error #6666
Comments
With the first time you mean after a fresh installation? After updating it? Which Piwik version are you using? |
I investigated more, and found that the problem exists when I activate a menu of my own plugin. I'm using the latest version, but I got it all |
Sweet. I'm closing it. Let me know in case you need any help or if anything is wrong/buggy with our API's |
Tsteur, the problem is not my implementation. |
Thx a lot. I haven't tried it but by having a look at the code I can kinda reproduce it (here: https://github.com/piwik/piwik/blob/master/plugins/CoreHome/templates/_menu.twig#L43) I guess you have defined your own "Report Category Name"? Internal note: I think we only do add a "2nd level item" here but never a "1st level item" for a custom category: https://github.com/piwik/piwik/blob/master/core/Plugin/Report.php#L338 Not sure how to fix this as when there are 10 reports using this custom category we do not want to add 10 1st level item etc. Maybe we can make Menu builder a bit more smart to add a new first level item category automatically (here https://github.com/piwik/piwik/blob/master/core/Menu/MenuAbstract.php#L153) in case there is none yet. In case one gets set later, we would overwrite only the first level item details. |
please leave a comment or +1 if you also experience this issue |
See my comment, I could reproduce it but there could be another bug. |
it sounds like an easy fix and will help plugin developers so definitely 👍 |
If you refresh (F5) the page, solves the problem.
I found a javascript error:
Uncaught TypeError: Cannot read property 'substr' of undefined
broadcast.propagateAjax( $(item).attr('href').substr(1) ); (menu.js line 43)
$(item).attr('href') return undefined
The text was updated successfully, but these errors were encountered: