# Broken link to an old post



## ColinJ (24 Apr 2016)

Hi Shaun.

I was just trying to direct Accy_cyclist to an old ride report of mine so I went to the ride thread to look for it. When I got there I remembered that I had actually posted the report in the 'Your Ride Today' thread and had linked to it from the forum ride thread. I just tried to follow that link but it took me to the wrong place. I found that my ride report is now on the following page. I know that the link worked at the time i.e. about 10 months ago.

The only way I could see this happening is for an extra post to have been inserted in the YRT thread before mine at a later date, which seems very odd.

THIS is the post with the link now pointing to the wrong place. The post that I wanted to link to is now on the start of the following page.

Any idea what happened there? Obviously, we don't want old internal links on the forum to start breaking later.


----------



## classic33 (24 Apr 2016)

Number of posts on a single page changed.


----------



## ColinJ (24 Apr 2016)

classic33 said:


> Number of posts on a single page changed.


If that is the cause then there will be an awful lot of broken links on the forum!


----------



## classic33 (24 Apr 2016)

ColinJ said:


> If that is the cause then there will be an awful lot of broken links on the forum!


Like this 9 Sep 2013 one?


classic33 said:


> See 9 Sep 2013 for what can be a typical A&E visit.


----------



## ColinJ (24 Apr 2016)

classic33 said:


> Like this 9 Sep 2013 one?


I don't think that the posts per page has changed - hasn't it always been 15?

But yes, that link does seem to be broken too.


----------



## classic33 (24 Apr 2016)

ColinJ said:


> I don't think that the posts per page has changed - hasn't it always been 15?
> 
> But yes, that link does seem to be broken too.


It has been 20 a page in the past.


----------



## ColinJ (24 Apr 2016)

classic33 said:


> It has been 20 a page in the past.


Ah, I think you could be right about that!

The problem in that case is that the page numbers embedded in old links are wrong even though the post numbers are still right.


----------



## classic33 (24 Apr 2016)

Origional
https://www.cyclechat.net/threads/tea-part-2.39457/post-2643005
As it is now
https://www.cyclechat.net/threads/tea-part-2.39457/post-2643005

Post number has remained the same, the page number has changed. The bottom one being the correct one.


----------



## ColinJ (24 Apr 2016)

classic33 said:


> Origional
> https://www.cyclechat.net/threads/tea-part-2.39457/post-2643005
> As it is now
> https://www.cyclechat.net/threads/tea-part-2.39457/post-2643005
> ...


Yep, looks like you've got it right - 2,566 x 20 = 51,320 and 3,421 x 15 = 51,315 which is near enough a match.

The answer would have been to take CycleChat offline and update the embedded page numbers before changing the posts per page number in all such links on the forum. A bit late now, unless the software updating the links could look at whether they were created before or after the change.


----------



## classic33 (24 Apr 2016)

ColinJ said:


> Yep, looks like you've got it right - 2,566 x 20 = 51,320 and 3,421 x 15 = 51,315 which is near enough a match.


Can you still edit the link?

That one of mine stands out because it's in the Any Survivors On Here thread


----------



## ColinJ (24 Apr 2016)

classic33 said:


> Can you still edit the link?


Yes. I think that longstanding members can edit posts for at least a year and that post of mine is about 11 months old. I looked at some 2 year old posts and I can't edit them.

I'm not going to start editing my old links though - there must be hundreds of them and many of them will be more than 1 year old!


----------



## ColinJ (24 Apr 2016)

I suggest that the forum software will have to stop looking at the embedded page number and just look at the post number which will always be correct.

I don't know what the ramifications of that would be, but at least links would once more pick up the posts that they link to.


----------



## classic33 (24 Apr 2016)

ColinJ said:


> Yes. I think that longstanding members can edit posts for at least a year and that post of mine is about 11 months old. I looked at some 2 year old posts and I can't edit them.
> 
> I'm not going to start editing my old links though - there must be hundreds of them and many of them will be more than 1 year old!


It's a workaround the problem, if nothing else.


----------



## jefmcg (24 Apr 2016)

This seems something that could be fixed in software. The page number in the links always seemed a bit unnecessary, very few threads not started by @Accy cyclist are more than a couple of pages long  There doesn't _seem_ to be much reason why you couldn't have links with just thread and post number (or even just the post number, they seem to be unique).

I'm sure there is a good reason ..... @Shaun?


----------



## classic33 (24 Apr 2016)

jefmcg said:


> This seems something that could be fixed in software. The page number in the links always seemed a bit unnecessary, very few threads not started by @Accy cyclist are more than a couple of pages long  There doesn't _seem_ to be much reason why you couldn't have links with just thread and post number (or even just the post number, they seem to be unique).
> 
> I'm sure there is a good reason ..... @Shaun?


Post would give Permalink, assuming you are able to see the post number in the thread to use it.


----------



## jefmcg (24 Apr 2016)

classic33 said:


> Post would give Permalink, assuming you are able to see the post number in the thread to use it.



I'm not sure what you mean. You post gets this link https://www.cyclechat.net/threads/broken-link-to-an-old-post.199508/#post-4250487, but if it was a multipage thread, the link would look like https://www.cyclechat.net/threads/broken-link-to-an-old-post.199508/post-4250487

Both work, so wouldn't it be simpler to make all post links not page dependent, then we could change posts-per-page without breaking everything.


----------



## classic33 (25 Apr 2016)

classic33 said:


> Origional
> https://www.cyclechat.net/threads/tea-part-2.39457/post-2643005
> As it is now
> https://www.cyclechat.net/threads/tea-part-2.39457/post-2643005
> ...





jefmcg said:


> I'm not sure what you mean. You post gets this link https://www.cyclechat.net/threads/broken-link-to-an-old-post.199508/#post-4250487, but if it was a multipage thread, the link would look like https://www.cyclechat.net/threads/broken-link-to-an-old-post.199508/post-4250487
> 
> Both work, so wouldn't it be simpler to make all post links not page dependent, then we could change posts-per-page without breaking everything.



Maybe that's the "something in the software" required. But you need to be able to get that number to do it.


----------



## Shaun (28 Apr 2016)

Yes, this is a consequence of changing the number of posts per page (which I did to reduce scrolling for mobile users.)

I'll have a look at this when I get chance; there may be a database query that can swap the links for direct _post_ links.

Cheers,
Shaun


----------



## ColinJ (28 Apr 2016)

I had a think about why you would reduce the posts/page and deduced that you would have done it for that reason.







And also that you had not anticipated this knock-on effect!


----------



## classic33 (28 Apr 2016)

ColinJ said:


> I had a think about why you would reduce the posts/page and deduced that you would have done it for that reason.
> 
> 
> 
> ...


Didn't know whether to believe me or not on the posts per page part at first though?


----------



## ColinJ (28 Apr 2016)

classic33 said:


> Didn't know whether to believe me or not on the posts per page part at first though?


It wasn't so much not believing you as me having a dodgy memory! Once you had persuaded me that the number of posts/page HAD changed, I asked myself why Shaun would make a change like that. The only thing that made sense to me was reducing scrolling requirements on small devices.


----------



## Shaun (15 Jun 2016)

I'm looking into this now and there appear to be around 2,000 links that may be affected. I can't remember the exact date I made the change, but should be able to narrow it down by testing the links in batches. Once I've found the broken links I'll set about repairing them, but it's a manual process so will take some time.


----------



## classic33 (15 Jun 2016)

Shaun said:


> I'm looking into this now and there appear to be around 2,000 links that may be affected. I can't remember the exact date I made the change, but should be able to narrow it down by testing the links in batches. *Once I've found the broken links I'll set about repairing them, but it's a manual process* so will take some time.


Have fun!


----------

