Advertisement:
GCWebhosting

Author Topic: RemoveTopic.php error  (Read 2407 times)

Offline w4rkr4f7

  • Semi-Newbie
  • *
  • Posts: 41
RemoveTopic.php error
« on: October 03, 2015, 09:32:12 AM »
Hi ,if I try to restore a message from Recycle Bin is giving me a error at line 1311 and message is not moving.

I have replaced in RemoveTopic.php

Code: [Select]
// Time to move the messages.
$smcFunc['db_query']('', '
UPDATE {db_prefix}messages
SET
id_topic = {int:target_topic},
id_board = {int:target_board},
WHERE id_msg IN({array_int:msgs})',
array(
'target_topic' => $target_topic,
'target_board' => $target_board,
'msgs' => $msgs,
)
);


with:

Code: [Select]
// Time to move the messages.
$smcFunc['db_query']('', '
UPDATE {db_prefix}messages
SET
id_topic = {int:target_topic},
id_board = {int:target_board},
icon = {string:icon}
WHERE id_msg IN({array_int:msgs})',
array(
'target_topic' => $target_topic,
'target_board' => $target_board,
'icon' => $target_board == $modSettings['recycle_board'] ? 'recycled' : 'xx',
'msgs' => $msgs,
)
);


Now message is moving and no more errors...

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,044
Re: RemoveTopic.php error
« Reply #1 on: October 03, 2015, 10:35:24 AM »
what error did you get?

i just tried to restore a topic and had no issues.

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,866
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: RemoveTopic.php error
« Reply #2 on: October 04, 2015, 06:14:13 PM »
I can't see how that change would fix an error unless the icon column was empty for some reason (which should never happen to begin with).
Michael Eshom
Cincy Space - now open!

Offline live627

  • Development Contributor
  • SMF Hero
  • *
  • Posts: 5,620
  • Gender: Male
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Re: RemoveTopic.php error
« Reply #3 on: October 04, 2015, 06:38:47 PM »
What is the error?
Try not to become a man of success, but rather try to become a man of value.
- Albert Einstein

Offline w4rkr4f7

  • Semi-Newbie
  • *
  • Posts: 41
Re: RemoveTopic.php error
« Reply #4 on: October 05, 2015, 09:20:01 AM »
What is the error?

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id_msg IN(19)' at line 5
File: /home/public_html/Sources/RemoveTopic.php
Line: 1311
« Last Edit: October 05, 2015, 10:02:11 AM by w4rkr4f7 »

Online Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,337
  • Gender: Male
    • Kindred-999 on GitHub
Re: RemoveTopic.php error
« Reply #5 on: October 05, 2015, 09:59:03 AM »
And have you made any changes to the default code yourself (in any of the files, not just that one)?
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline w4rkr4f7

  • Semi-Newbie
  • *
  • Posts: 41
Re: RemoveTopic.php error
« Reply #6 on: October 05, 2015, 10:04:27 AM »
And have you made any changes to the default code yourself (in any of the files, not just that one)?

If I'm changing codes posted on first message of this topic error is gone and topic is moved ,anyway I just posted that just for other users having same error (maybe I'm only one with bad luck..)

Online Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,337
  • Gender: Male
    • Kindred-999 on GitHub
Re: RemoveTopic.php error
« Reply #7 on: October 05, 2015, 10:27:14 AM »
you have missed the point of my question.

You ahve reported a bug.

Per Oldiesmann -- your edit should have no effect unless the icon column was empty.

That should never happen.

We can not recreate your error on a clean installation.

So... you are encountering and error that should not happen and can not be recreated...   
I am asking you -- have you edited ANY of the files for 2.1beta2?  Not just the "fix" which you posted above --- have you made ANY OTHER EDITS - TO ANY FILE?
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline live627

  • Development Contributor
  • SMF Hero
  • *
  • Posts: 5,620
  • Gender: Male
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Re: RemoveTopic.php error
« Reply #8 on: October 06, 2015, 01:10:39 AM »
Try not to become a man of success, but rather try to become a man of value.
- Albert Einstein

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,866
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: RemoveTopic.php error
« Reply #9 on: October 13, 2015, 12:36:35 PM »
Fixed on GitHub: https://git.io/vCgGD
Michael Eshom
Cincy Space - now open!