CNS topic move
Posted
#5781
(In Topic #1361)

Standard member

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']
Code
$topic_info['id']
^^^^^^^^^^^^^^
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:
- Post in forum that has default access rights for the Regular group
- Move post
- Select destination with same permissions, selecting or not selecting redirect has no impact on results
- After clicking move topic one is presented with the stack trace
- Looking back at the forumview page, the move has not happened (strack trace is pre action)
- Hit refresh and click resend
- No stack track, no warnings
- 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
- 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)
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):
A manual Tools -> Website cleanup tools -> Forum was required to set things straight again.
Thanx!
Last edit: by SoccerDad
"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved
just peace, unity, tolerance and love" - The Beloved
Posted

Site director

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.
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
1 guest and 0 members have just viewed this.