Moving a thread to new forum and leaving a redirect (fails)

MikeChannon

Member
Hey guys, I'm the Forum Admin at XDA-Developers.com and.......

Redirects left when a thread is moved to a diferent forum do not work.
e.g the following thread was moved to the Galaxy Note 3 Q & A forum from the Galaxy Note 3 General forum:
https://forum.xda-developers.com/t/note-3-home-screens.2438689/
A 3 month re-direct was left in the General Forum:
https://forum.xda-developers.com/t/note-3-home-screens.4313959/
(the redirect has an incorrect thread number)and if it helps you'll see the redirect in-situ on this page with thread title Note 3 Home Screens:
https://forum.xda-developers.com/f/galaxy-note-3-general.2493/page-83This is happening with all redirects that are left by Moderators.Any help to resolve this appreciated.

We're a forum migrated from vB BUT the redirect error happens with all such cases whether they be old threads or new and always result in the "Ooops" error.... you do not have permission etc error when you click the redirect link.
 
The redirect having a different thread ID is expected. Redirects are actually thread records which, when hit, we redirect to the original thread.

I get asked to log in to view the redirect URL which is unexpected but I can’t think of anything in the default software that would cause this.

Do you have a more recent example? This one is before your migration to XF so I can’t rule out an error during import.

Will move this thread to troubleshooting for now. Unlikely to be a bug until we have a solid reproduction case, but also I’ll leave a redirect in the Bug forum so you can verify the behaviour as it should work.
 
Just noticed you're not showing as licensed and therefore may be unable to reply, currently.

Someone will need to log into the customer area of the xda-developers license and add your forum username to the "Forum users" section, you'll then be able to post in here and other customer parts of the forum.
 
Just as some additional information to help with this, as I'd briefly looked into the issue to see if it was anything obvious...

Have reproduced this with 2 threads, the latter newly created and redirected - these are on a staging installation as I don't have access to production, but it rules out a race condition or a quirk due to high activity I suppose.

Thread 1:
Thread URL: t/g998u-and-g998u1-firmware-links-and-flashing-discussion-here.4220111/
Redirect thread ID: 4292901
xf_thread_redirect row: 4292901, t/g998u-and-g998u1-firmware-links-and-flashing-discussion-here.4220111/, thread-4220111-12091-

Thread 2:
Thread URL: t/test-move.4292902/
Redirect thread ID: 4292903
xf_thread_redirect row: 4292903, t/test-move.4292902/, thread-4292902-256-

In both instances the redirect thread leads to a no permissions page, with the URL including the ID of the redirect thread (e.g. t/test-move.4292903/ for the second example).

As far as I can see, the data in the database is correct at least? I haven't traced through the rest of the code to see where it generates the error but if it can't be reproduced elsewhere, we may just have to.
 
Last edited:
The only place in the normal execution flow that might return a no permission error is this code:

PHP:
if (!$thread->Redirect)
{
   return $controller->noPermission();
}

But if the data is correct then that shouldn't be an issue.

If you set the following in src/config.php on the staging site:

PHP:
$config['enableListeners'] = false;

Does the behaviour change?
 
Yeah.

Should be safe to remove $config['enableListeners'] = false; now.

You probably want to disable all add-ons and enable each, one by one, to see which one brings the issue back. If I had to guess then an add-on is using the entity_structure class property, or a class extension on XF\Entity\Thread::getStructure and overriding, removing, or otherwise modifying the Redirect relation.

I might be wrong and it could be in other places or code but the Redirect relation no longer working would seem to cause a no permission error.
 
Yep, confirmed to be the issue, seems to due to some code handling legacy vB threads that didn't contain any posts. We can mark this as resolved @MikeChannon (if we can/need to :))
Just to be clear, this is/was happening on newly created threads as well, not just vB legacy stuff. I created and redirected a brand new thread yesterday and the redirect worked the first time, but 5 minutes later I was getting the no-permission error.

So is it fixed? I'm not sure when you say it is related to legacy vB threads???

The thread I created yesterday, moved and gave a re-direct to is still not working and was nothing to do with legacy vB threads:

Quote from a few posts above:

Mike
 
Just to be clear, this is/was happening on newly created threads as well, not just vB legacy stuff. I created and redirected a brand new thread yesterday and the redirect worked the first time, but 5 minutes later I was getting the no-permission error.

So is it fixed? I'm not sure when you say it is related to legacy vB threads???

The thread I created yesterday, moved and gave a re-direct to is still not working and was nothing to do with legacy vB threads:

Quote from a few posts above:


Mike
Yep, it's an addon with code intended to handle a legacy vB issue, but has an unintended consequence of breaking redirect threads regardless of when they were made. I need to fix the addon but can update internally.
 
Back
Top Bottom