CNS topic move

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by Chris Graham)
#5336 (In Topic #1080)
Hola!

Noticed an issue with my installation when moving a forum topic to a different forum. There is a stack trace generated complaining about the 'id' variable as undefined on line 431 of cns_topics_action2.php. Currently it reads as

Code

$topic_info[0]['id']
Changing this to

Code

$topic_info['id']
appears to make the issue go away.

^^^^^^^^^^^^^^

Scratch all that, I committed the cardinal sin of troubleshooting: tested a solution without recreating the exact steps that lead to the original error. Can I blame it on aging? ;)

Here's what's happening:

  1. Post in forum that has default access rights for the Regular group
  2. Move post
  3. Select destination with same permissions, selecting or not selecting redirect has no impact on results
  4. After clicking move topic one is presented with the stack trace
  5. Looking back at the forumview page, the move has not happened (strack trace is pre action)
  6. Hit refresh and click resend
  7. No stack track, no warnings
  8. Looking back at the forumview page: the move has happened but a redirect of sorts exists in the Last Post column: the link is clickable and the destination correct
  9. Going into the forum itself reports no posts

Code

PHP NOTICE [8] Undefined index: id in sources/cns_topics_action2.php on line 431 (version: 10.0.25, PHP version: 7.2.17, URL: /forum/index.php?page=topics&type=_move_topic&id=32)

top_move_01.jpg

top_move_02.jpg

Lastly, and not sure if this is by design, after deleting the actual posts, I was left with this (General Chat was where the posts were moved from, Site Feedback the destination and where I deleted them):

top_move_03.jpg

A manual Tools -> Website cleanup tools -> Forum was required to set things straight again.

Thanx!

Last edit: by SoccerDad


Post

Posted
Rating:
#5369
Thanks for the detailed report and fix.
I did a slightly different fix a while back from an automated error report I saw:
https://github.com/ocproducts/composr/commit/dcb6208197c5c476106e2d938be7cf2bf2d31e77#diff-a25f879bc9b00d68935006028336366b
Only affects when moving 1 single topic.
1 guest and 0 members have recently viewed this.