vanilla Flagging content "Take Action" button link broken - PHP

Describe the bug Flagging a comment and then viewing the flagged content in dashboard contains a broken link on the Take Action button due to double link /forum/forum/...

Vanilla info 1. Are you sure this is a core Vanilla problem and not caused by any addon you are using? It's a core plugin. 2. Did you follow our generic troubleshooting steps already? Yes 3. What Vanilla version are you using? 3.3 4. When did the issue start? Since we upgraded to 3.3. Nothing else changed.

To Reproduce Steps to reproduce the behavior: 1. Open a thread 2. Flag a comment 3. Navigate to /forum/plugin/flagging and see the flagged content 4. See the broken link on the Take Action button - it's double linked /forum/forum/....

Expected behavior Should link correctly to the comment.

Screenshots forum broken flag link-d

Notice in the database flag table it has /forum/ attached, I believe this is the source of the problem. Maybe this needs to only link to /discussion/.... ?

forum flag db

Further digging

This particular line comes back with a url of /forum/discussion/.... which means when it eventually gets output it ends up getting a double /forum/ link. Suspect commit: https://github.com/vanilla/vanilla/commit/b3a7e75da488fa1ecf3258966e317a4ea8c30696#diff-63c3861437753698c746fd45603d4f74 - this seems to suggest the original method stored it minus the /forum/ part in the db.

Asked Oct 16 '21 11:10
avatar garygreen
garygreen

2 Answer:

Anyone stumbling across this - we've put a temporary fix in place by redirecting in nginx:

# Fix flagging issue linking to double /forum/
location ~ ^/forum/forum/(.+) {
    return 302 /forum/$1;
}
1
Answered Aug 05 '20 at 17:39
avatar  of garygreen
garygreen

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

1
Answered Aug 07 '21 at 16:17
avatar  of stale[bot]
stale[bot]