@Findus23 opened this Pull Request on June 8th 2021 Member

reported in https://forum.matomo.org/t/i-get-an-error-when-i-click-to-activate-the-plugin/42173/2

It turns out unlike the regular "activate plugin" buttons, the ones shown after uploading a plugin zip don't have a redirectTo GET parameter set.

https://github.com/matomo-org/matomo/blob/587cc39e0362719332d410b7a4d5ddcc68788eeb/plugins/CorePluginsAdmin/templates/uploadPlugin.twig#L29

This should not matter as an empty value means redirecting to the plugin or theme list (which is what we want.

https://github.com/matomo-org/matomo/blob/792bc0cfd5bc9365351097e07710f3148f3b3f32/plugins/CorePluginsAdmin/Controller.php#L469-L476

But https://github.com/matomo-org/matomo/pull/17345 added a section that reads the parameters, but forgot to set a default value for redirectTo in case it is missing, throwing the error reported on the forum

Review

  • [ ] Functional review done
  • [ ] Potential edge cases thought about (behavior of the code with strange input, with strange internal state or possible interactions with other Matomo subsystems)
  • [ ] Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • [ ] Security review done see checklist
  • [ ] Code review done
  • [ ] Tests were added if useful/possible
  • [ ] Reviewed for breaking changes
  • [ ] Developer changelog updated if needed
  • [ ] Documentation added if needed
  • [ ] Existing documentation updated if needed
@diosmosis commented on June 8th 2021 Member

Thanks for the fix @Findus23!

This Pull Request was closed on June 8th 2021
Powered by GitHub Issue Mirror