How find a message after moving?

Started by Anik, December 06, 2009, 10:02:17 AM

Previous topic - Next topic

Anik

Thing is

Was post, for example /topic,10800.msg318940.html#msg318940

Someone wrote or direct url on it or used it in quotes on in karma description mod.
After post was moved to new topic, for example /topic,10700.msg318940.html#msg318940

of cource old url points to topic, where this message was in past, but is not in present.

How we can "recalc" all this links, or is any other way to fix this problem?

Ways actually is two:
if message 318940 still exists on forum, but already in another topic, we should open it in new topic (10700) - with new url
if message was deleted - open old theme (10800)

Found it we can by SQL
SELECT `ID_TOPIC` FROM `smf_messages` WHERE `ID_MSG` = 318940

But how recalc ALL this links? Maybe someone can construct mod for this job?
And call this function every time together with forum maitenance?

Or dimamically find new topic every time calls a link? I don't know what will be faster and easer..

Norv

Both could be done, though probably adding a links checking and modification to the forum maintenance is a better choice for performance at least.
As a side question, I wonder, while I understand the main problem, still how many times do you really think it's needed to change these links? Usually messages are not moved, at most the entire thread is moved if posted in the wrong area. Moreover, from the few times when messages are indeed moved to another topic (perhaps topics were split), a lot less will happen to have a link to them somewhere, if any. I'm sure this never happened to my forums.

Or were you referring to this site? Well, this is a huge forum, indeed there will be a few cases that you don't really happen to see on other forums (not because they're impossible, they're clearly possible, but quite unlikely).
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Anik

We have a large forum too - about 200 messages per day more than three years.

And peoples often wrote messages not by topics but quite occasionally. And moderators move posts with delay - "old" links realy maybe puts in database.
So problem with links exists very long time on our forum.

We really very need to recalc all links in texts (direct links), in quotes, in karma description mod, and so on... All of them. Because many of links shows to "nothing".
Of course part of posts have been deleted, but part is just moved.

Question is - how to fix this situation?...

Can you really add this feature in forum maitenance?
Or construct additional mod for this job?

MrPhil

Let me see if I understand the situation. A member posts a message, and some time later a moderator moves it to another topic, or moves the whole topic, or splits or merges topics, or whatever. SMF itself is working fine after this operation (the message is still accessible, etc.). However, in the mean time, someone has made an "external" link (within another message, or even from outside your forum). The given topic number is now incorrect, even though the message number is unchanged, and the viewer gets an error from SMF. Is this what's happening?

I don't think it would be practical to go through the entire message database each time a message is moved, and find and update the topic number in that message. That also wouldn't work for references from outside of SMF. What might be a practical mod would be to keep a "moved message" table, holding for each move the old and new topic numbers and the message number. If a reference is made for a no-longer valid topic+message, instead of immediately returning an error message that the message can't be found, first look in the smf_moved_messages table to try to match the old topic and message number (or maybe just the message number). If found, resume with the new topic and message number -- sort of an internal URL rewrite, you might say. If a message number might change in the process, we might store the new message number too. If a message is moved more than once, update the existing entry rather than adding a new entry, so the redirection is done only once.

Anyone want to write this mod? How will it interact with SEO/pretty URL mods?

Norv

Quote from: Anik on December 09, 2009, 06:39:09 AM
Can you really add this feature in forum maitenance?
Or construct additional mod for this job?

It seems very unlikely it would be added to the default maintenance feature (that is, in core SMF), at least for the reasons above: for many forums it is unlikely it would be useful even for a single message, let alone enough messages to warrant the addition, IMHO.
However, I do see how a mod would plug in the existing maintenance feature and add this into it.

MrPhil's suggestion could also be an option, though by the sound of it, it would only work from this point forward (not older messages that were moved).

ETA: either way, I can move this thread to Mod Requests board, if you want, so that potential modders might look into it.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Arantor

There is a mod that will do some of this for 2.0 - Redirection Topics also makes the 'MOVED: xyz' topic a redirect to the original topic, but there are no plans to back port since that mod also uses scheduled tasks to make the old topic disappear after a set period of time if the moderator sets that.
Holder of controversial views, all of which my own.


Anik

Arantor

Question not about moving topics between boards!
Question is about moving posts between topics!

Quote from: Norv on December 11, 2009, 09:54:38 AM
I do see how a mod would plug in the existing maintenance feature and add this into it.
Quote from: MrPhil on December 09, 2009, 09:34:54 AM
Anyone want to write this mod?

I think that write this feature should SMF team  ::)
Because it is a bug in SMF logic.


Arantor

Yes, I know I'm an idiot and misread it. It's not actually a bug in SMF logic per se, by the way.

And no, I'm not going to write this mod, sorry.
Holder of controversial views, all of which my own.


Anik

Quote from: Arantor on January 25, 2010, 02:57:43 PM
It's not a bug in SMF logic

It is.

If link to post contains a topic number, you should to provide that this number can be changed after regular SMF operations - split and merge.

Quote from: Arantor on January 25, 2010, 02:57:43 PM
I'm not going to write this mod.

So, this bug still exists in all next versions of SMF?
It is oficial position of SMF team?

Arantor

How is it a bug? It was a quote at the time it was made, and was correct at the time it was made. If you're going to argue that, at the same time you need to argue the fact that the quote's author is equally incorrect if the user ever changes their display name, which is why some of my posts were quoted over the Christmas season and state "Quote from: The Grinch" despite being my posts.

You realise, though, that to change this would mean examining every single message in the database to update it, which would kill larger forums.

It's not up for change in 2.0, and it's been the case since 1.0, so I really can't see it changing, though it would be possible to do something about it.
Holder of controversial views, all of which my own.


Anik

Quote is clickable? Yes, it is.
What for it is clickable? Only for goal to find post qoute was made from.

So?

Arantor

I'm not arguing that it's clickable. I'm arguing that it can be wrong in other ways too as *well* as what you've highlighted.
Holder of controversial views, all of which my own.


Anik

Sorry, but your opinion isn't interesting for me anymore.
As I see, You are just a local flooder. First place in posters top and posts empty by content.

I just ask You to stop participate in this thread and waiting for official answers from SMF team.

Question is: why after regular SMF operations - split and merge, all links to splitted message become unusable, and how do you think to fix this bug in SMF forum program.


Arantor

I would point out that until 2 weeks ago, I *was* part of the official team, as a writer and reviewer of mods, as well as trying to fix other bugs in SMF.

They become unusable because they are not re-resolved upon merging for performance reasons, though a smallish change to how the action handler is resolved (i.e., not including the topic id in quoted messages) could fix it, though it will have other side effects too.

I would point out this has been an issue since SMF 1.0 back in 2004 and is not scheduled for change even in SMF 2.0 which is still under development.

AND, there is still the adjoining issue I raised that the quote header isn't being updated when the poster changes. They are entirely related issues, but hey, what do I know.


Fair enough I will leave this thread. This isn't the first time I've been asked to leave threads. Should have left the forum before.
Holder of controversial views, all of which my own.


Anik

It's very sad that in new version 2.0 this bug still not fixed  :(

JimM

As was stated previously, it's not considered a bug, thus the developers are not working on a fix. :)
Jim "JimM" Moore
Former Support Specialist

Anik

It's seems that you are not understand that is bug.
Do you think that bug it's only when program trapped?

So.
If possible put in post link to other post,
If possible to move posts,
Then please fix error when this link don't work after post moving.

JimM

I read through this entire topic.  I understand from your point of view it is a bug.  I just happen to disagree with you.  As Norv offered,  we can move this topic to the Mod Requests board and maybe a modder will be interested in doing it.  Would you like me to do that?
Jim "JimM" Moore
Former Support Specialist

Anik

Quote from: JimM on July 21, 2011, 07:55:19 AM
... maybe a modder will be interested in doing it.
Would you like me to do that?

Sure I want it!

If SMF team can to make mistake in forum logic, but cannot to fix it - maybe instead of official software engineers this error can to fix other peoples?
Because it's a bug ;-)

And at large forums after three years of moderation (sorting messages!) many links in posts and karma descriptions is not valid anymore. It is normally? It isn't bug? ;-)

Advertisement: