CNS topic move

Post

Posted
Rating:
Item has a rating of 5 (Liked by Chris Graham)
#5781 (In Topic #1361)
Avatar
Standard member
SoccerDad is in the usergroup ‘Community saint’
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


"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved
Online now: No Back to the top

Post

Posted
Rating:
#5823
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Thanks for the detailed report and fix.
I did a slightly different fix a while back from an automated error report I saw:
Fix issue moving one single forum topic, problem with sitemap rebuild… · ocproducts/composr@dcb6208 · GitHub
Only affects when moving 1 single topic.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • 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.
Online now: No Back to the top
1 guest and 0 members have just viewed this.

Statistics

Users online:

gabriel58, babu, MVLipwig, Paul D, amit.nigam, Salman, Philip, Manu

Forum statistics:
  • 1,110 topics, 5,333 posts, 6,276 members
  • Our newest member is sharecredentials
Birthdays:
Back to Top