I've just run into an issue where I have anonymous and authenticated users being able to create draft content that is then moderated by site editors and published/rejected. I want to redirect the user back to the homepage after they've created it, but the workbench_moderation module does not use the same check as the node module for redirection after submission so the user ends up on an Access denied page after saving the form and there's no way to stop this without altering the weight of the modules in the system table.

Patch to follow.

CommentFileSizeAuthor
#2 2545782-check-access-redirect-1.patch1016 bytesacbramley

Comments

acbramley created an issue. See original summary.

acbramley’s picture

Status: Active » Needs review
StatusFileSize
new1016 bytes

Here's the patch

anybody’s picture

Status: Needs review » Needs work

Hi,

I can confirm this problem, just ran into the same. Your solution is a good starting point, but it would be better to make the return path configurable and not set '' in code.

Furthermore workbench_moderation has the problem that this hook completely kills 'destination' parameter, which would be preferrable to use.

So your patch solves one of the problems but leaves others open in this context.

anybody’s picture

Status: Needs work » Closed (duplicate)

Let's close this as duplicate and join efforts in #3111694: Do not override 'redirect' by hard on node form submit (also D8). There are many similar issues all based on this hook implementation. Thank you!