4 ms·
My first major Drupal project was for a local newspaper (now defunct… hopefully my site wasn't too big a factor in that) to which many writers were publishing a
by Cyberdog 5y ago
My first major Drupal project was for a local newspaper (now defunct… hopefully my site wasn't too big a factor in that) to which many writers were publishing articles, first to a "staging" site for sign-off to an editor, then to the live site. One of the many, many problems we ran into on that project (it was definitely a learning experience for all involved) is that the writers would link to other articles by finding the article on the staging site, copying the link, and then pasting that link into the article. When the article was published to the live site, that link was still linking to the staging site's URL which was inaccessible to the broader internet, so they were effectively broken links.
To fix this I wrote a Drupal "input filter" called Pathologic which basically found all internal links in content and tried to rewrite them to point to the same content on the "current" site (which would be the live site after the article was published there). Eventually, after feedback from others, it could do other tricks like rewrite absolute paths to relative ones and vice versa (so your paths could be relative in a web browser, but absolute when the content was published via RSS feed or email), make sure http:// http:// vs https:// https:// was sorted out, and so on - broadly speaking, its goal was to make sure that links to internal content were always correct in all circumstances, and except for a few bizarre edge cases (there were always bizarre edge cases, though I'm glad to say they got exceedingly bizarre as the project matured), it met that goal. It became quite popular in the Drupal ecosystem and was my most successful open source project by far in terms of the number of users.
Sadly, in recent years, I haven't been able to work with Drupal except for either small personal projects or projects that ended up failing before launch, so the code is now in disrepair and won't run well on current releases Drupal 8 or 9 if it runs at all. I'm hoping some day I'll be commissioned for a new Drupal project again and have the motivation to get it updated, but for now it has rotted. I'm still really proud of how many people it helped out in its heyday, though.
https://www.drupal.org/project/pathologic https://www.drupal.org/project/pathologic