Poll authors redirected to admin/content/poll

Created on 7 November 2022, about 2 years ago
Updated 30 January 2023, almost 2 years ago

Problem/Motivation

I have a role set up for users to create polls but not to administer them.
After creating a test poll logged in as one of these users, I am redirected to /admin/content/poll. Since I don't have permission to access that page, I get Access Denied, along with notice the poll was successfully crated.

Should the user be redirected to whatever page they were on when they clicked /poll/add ?

Is there a workaround or config setting I might have wrong?

πŸ’¬ Support request
Status

Active

Version

1.5

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States aharown07

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States aharown07

    I don't know how to code a "return to where you were when you clicked /poll/add" route.

    What I've done as a workaround may be useful to someone (replacing WHATEVER as needed)

    β€’ Step one: create new route in poll.routing.yml

    poll.poll_WHATEVER:
    	  path: '/WHATEVER'
    	  defaults:
    	    _title: 'WHATEVER'

    β€’ Step two: change route name in poll/src/Form/PollForm.php to use the new route instead of poll.poll_list
    This is currently line 70. Looks like this: $form_state->setRedirect('poll.poll_list');

    Of course, this approach requires re-hacking after any update to poll module.

  • πŸ‡ΊπŸ‡ΈUnited States aharown07
  • Status changed to Closed: won't fix about 2 months ago
Production build 0.71.5 2024