[Vue] make sure spaces are encoded as %20 in URLs since some parts of matomo do not decode + properly #19299
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
The Vue code uses $.param() to stringify query params (primarily to handle nested arrays in URLs that some parts of matomo expect). This function uses '+' to encode spaces, which appears to cause some issues in other places of matomo. For example, in the Vue migration for UsersFlow, highlighting a page title w/ a space in it will display '+' in the popup title because '+' is sent as the rowLabel parameter (see the relevant PR for screenshots). The angularjs code constructs the URL w/ encodeURIComponent directly, which uses %20. This seems to work in the popup title.
Fixed in this PR by changing '+' to '%20' manually after constructing a query string.
Review