• The NAWCC Museum and Library & Research Center will reopen starting Wednesday, January 6, 2021 as per Governor Wolf's reopening mandate.

Autolinks Don't Always Work

Kent

Registered User
Gibbs Literary Award
NAWCC Fellow
NAWCC Silver Member
Aug 26, 2000
18,503
1,894
113
Country
I just used the text "American Watch Case Co." in a reply to a post. Since this is the title of an Encyclopedia article which (prior to the server move) used to create an autolink to the article, I suspect that something is now inhibiting the function.

This happened yesterday in an earlier post in the same thread when I used the text "Philadelphia Watch Case Co."

In both instances, when those autolinks didn't work, I had to go back and create them.

Can this be fixed?
 

Tom McIntyre

Technical Admin
Staff member
NAWCC Star Fellow
NAWCC Ruby Member
Donor
Aug 24, 2000
83,643
1,806
176
84
Boston
awco.org
Country
Region
It is still supposed to work. After the upgrade, we were getting lots of spurious links to articles not in the main Encyclopedia area such as templates , etc. I put all those in an exception area so they would not autolink but the autolink rules were changed and there may be other problems.

I think the Encyclopedia developers do a great job but they have had a rough couple of years since hurricane Sandy. I expect the software to be much more solid shortly.

American Watch Co. and Philadelphia Watch Case Co.

reparse....
 
Last edited:

Tom McIntyre

Technical Admin
Staff member
NAWCC Star Fellow
NAWCC Ruby Member
Donor
Aug 24, 2000
83,643
1,806
176
84
Boston
awco.org
Country
Region
It should be OK now. The subtle issue was the recognition of periods in titles.

Here is the developers reply to the problem report.
It should be working as expected now.

The problem with autolinks is allowing all cases to autolink, even though the rules are in conflict with each other:

- Only link whole words. Determining if it's a "whole" word depends on a whitelist of characters that can be considered a boundary of any word.
- Adjacent words should be possibly autolinked, so boundaries should be excluded from the result set.
- Words including the URL space character should be autolinked.
- Exclude words that start or end with a hypen - or _. Even though it's a special character, it is probably part of another word like wave-motion or a function_name and therefore not a distinct word.
- Allow words to contain characters that technically aren't word characters (like periods or hyphens), but still disallow those characters at the boundaries.

You were occasionally running into a collision with the last rule, since you have article names that end in a period, and you want them to autolink. Sometimes PHP was failing to find a boundary after the period, because the period itself is usually considered a boundary.
 

Kent

Registered User
Gibbs Literary Award
NAWCC Fellow
NAWCC Silver Member
Aug 26, 2000
18,503
1,894
113
Country
American Watch Case Co.

Philadelphia Watch Case Co.

Yep, worked now. But I notice that it didn't work retroactively to appear in the posts earlier in this thread.
 

Tom McIntyre

Technical Admin
Staff member
NAWCC Star Fellow
NAWCC Ruby Member
Donor
Aug 24, 2000
83,643
1,806
176
84
Boston
awco.org
Country
Region
The auto-linking occurs when the post is parsed and filed. It is possible to re-parse all the posts, but it is an intensive server load and some users might be surprised to see links appear where there were none before. If they see links appear while posting, they can make a small change in the text or, if they know the system well use the NOPARSE tag. I am still trying to decide what to do.

Any suggestions?
 

Tom McIntyre

Technical Admin
Staff member
NAWCC Star Fellow
NAWCC Ruby Member
Donor
Aug 24, 2000
83,643
1,806
176
84
Boston
awco.org
Country
Region
It turns out, I was mistaken. The post is parsed when anyone reads it and the result saved in a cache table. It is sufficient to delete the contents of the cache table to fix them all.
 

Kent

Registered User
Gibbs Literary Award
NAWCC Fellow
NAWCC Silver Member
Aug 26, 2000
18,503
1,894
113
Country
American Watch Case Co.

Philadelphia Watch Case Co.

Yep, worked now. But I notice that it didn't work retroactively to appear in the posts earlier in this thread.
Tom:

I'm not sure I understand what you're saying, but the autolinking originally worked in my post #4 but it seems to have got lost since yesterday.
 

Tom McIntyre

Technical Admin
Staff member
NAWCC Star Fellow
NAWCC Ruby Member
Donor
Aug 24, 2000
83,643
1,806
176
84
Boston
awco.org
Country
Region
The scope of auto-linking is the thread. i.e. once an auto-link appears in a thread the same auto-link is not repeated. Originally the first post had not had a link but after Pegasus fixed the white list to allow periods in names, it did auto-link. However, the previous behavior with the #1 not auto-linking and the #4 auto-linking was in the post cache. When I cleared the post cache, the thread was re-parsed and assumed the design behavior. i.e. it now links the first occurrence in a thread and no further occurrences.
 

Kent

Registered User
Gibbs Literary Award
NAWCC Fellow
NAWCC Silver Member
Aug 26, 2000
18,503
1,894
113
Country
... the design behavior. i.e. it now links the first occurrence in a thread and no further occurrences.
Okay, just so I'm clear about this, whereas previously the autolink would work on the first use in A Post, currently it only works the first time it is used in a thread?
 

Tom McIntyre

Technical Admin
Staff member
NAWCC Star Fellow
NAWCC Ruby Member
Donor
Aug 24, 2000
83,643
1,806
176
84
Boston
awco.org
Country
Region
Yes, I noticed that too, but did not complain since the change seemed right.