Leuchtfeuer/locate

Bug when redirecting to page defined by PID due to multiple ID parameters in URL

bitmotionAE opened this issue · 0 comments

Error occurs when defining a redirect action to a specific page like this:

plugin.tx_locate_pi1 = USER_INT
plugin.tx_locate_pi1 {
    userFunc = Bitmotion\Locate\Locate->main
    actions {
      redirectToPageDE {
            20 = \Bitmotion\Locate\Action\Redirect
            20.page = 25
            20.sys_language = 1
      }
      default {
            20 = \Bitmotion\Locate\Action\Redirect
            20.page = 25
            20.sys_language = 0
      }
    }

    ...
}

In this case you are not redirected to page 25 but you stay on the page where you are. The reason is, that the RedirectToPid method adds all URL parameters when trying to redirect, including the ID of the current page. The resulting redirect URL is something like this: www.example.com/index.php?id=25&L=0&id=1.

When adding the current URL parameters the parameter id should be left out if a specific page ID to redirect to has been defined.

Pull request: #4