Fixed Poll creation redirects to itself instead of thread

Affected version
2.2.8
Steps to reproduce
1) Either visit [thread]/poll/create directly or open the thread view's 'create poll' link in a new tab.
2) Fill the form and submit.
3) The page will submit to itself, creating the poll, but will then redirect to itself and display a no permission error.

This happens because XF\ControllerPlugin\Poll::actionCreate uses a dynamic redirect after the poll is created. Since these 2 scenarios don't have referrers or ajax referrers, and since the poll creation form doesn't provide a redirect url, it just redirects to itself.

The no permission error is correct though, albeit misleading. Another poll can't be created because the thread type is now poll.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.9).

Change log:
Pass referrer through poll creation form
There may be a delay before changes are rolled out to the XenForo Community.
 
This doesn't appear to be resolved. As of 2.2.9, it now redirects to the homepage instead of the poll creation page, but it still doesn't redirect to the original thread.
 
It works if there is a valid referrer (eg. when opening the page from the thread), but not if you navigate manually. I've added a fallback URL for when there is no referrer and expanded this to poll edit and deletion so it should be more robust in future versions.
 
Back
Top Bottom