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
When loading a template url from a custom plugin directory, prefix the relative directory #14717
Conversation
…e relative directory
I am not sure if it's related but I am trying to use custom plugins folder for some of premium plugins like ABTesting, or SessionsRecording, When Selecting them from the left menu, nothing is displayed in the main content ( no errors in browser's console / network ) For ABTesting plugin, the following files are 404, i guess because it's not not taking in account custom folders relative path:
Thanks. |
Yes it's related to that. Feel free to give the patch a try and let me know if it works 👍 |
Unfortunately, i am on a Docker environnement right now, so i will wait for the official Thanks |
var urlParts = config.url.split('/'); | ||
if (urlParts && urlParts.length > 2 && urlParts[1]) { | ||
var pluginName = urlParts[1]; | ||
if (pluginName && pluginName in piwik.relativePluginWebDirs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pluginName
check in the if is redundant here since urlParts[1]
is checked above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be safer to check if (piwik.relativePluginWebDirs[pluginName])
instead of pluginName in piwik.relativePluginWebDirs
in case the value is falsey?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added another check. I think we could remove plugin in ...
but had sometimes problems with it in past not sure why.
In #14051 we started supporting multiple plugin paths.
There we already rewrite the path to the JS and CSS assets and load them from a different path. But it looks for some reason that a
directive templateUrl
is not loaded correctly when the plugin is located in a different path. It's still trying to load the template file eg from$matomoUrl/matomo/plugins/PluginName/angularjs/widgetname/widgetname.html
when instead it should be maybe loaded from$matomoUrl/matomo/../extensions/PluginName/angularjs/widgetname/widgetname.html