Can Internal link paths are be validated to see if they actually exist?

Comments

nmc’s picture

Category: support » feature
dqd’s picture

Version: 7.x-1.0-alpha3 » 7.x-1.x-dev

hm, good question...

since the values must be already there to get validated, it smells like a autocomplete term widget kind of solution, but which has to fetch all internal links before node/edit is fully loaded. Not sure if it makes sense on bigger projects. And validating by save is a no go, I would say, since there can be pictures, videos and many more to be handled same time what makes the whole saving process near by getting broken.

Another workaround could be to start a new project serving all internal links to the user without navigating to url-aliases, and where the user can choose from, like from tokens. Maybe a kind of "internal links" widget for link module? But maybe rather an extra module? This would at least be drupal-like and could be re-used from any other module.

Hm , ... Or am I wrong?

nmc’s picture

I wasn't looking specifically for an autocomplete type of widget. I just noticed that if I type junk into the field like 'asdfasdfasdfasdf', then the link field module assumes this to be an internal path and creates the link as such, but without checking to see if the internal path of domain.com/asdfasdfasdf is a valid path that actually resolves to a page. (using drupal_valid_path(drupal_get_normal_path($text)) perhaps?)

dqd’s picture

Status: Active » Postponed (maintainer needs more info)

hm ,yeah I know. But the problem persists that a Drupal installation has many links, even if they are not all visible for search engines. Think of pathauto, path patterns and Global redirect. I assume saving a link would cost too much memory and would low down the performance of the link module immediately. That's why I thought about a link list of all excepted links like article/title instead of artice/title, node/12 and node/12/0 and such ... to prevent that the wrong links get used by chance and validated since they logically exist.

anrikun’s picture

Hi, I am the maintainer of CKEditor Link.
Originally this module is meant to provide an easy way to create links to Drupal paths from CKEditor.
But as it has no dependencies, it could be used here as an API to provide such an autocomplete feature to Link.
It could be a sub-module if not directly added to Link.
I don't have time to work on this now but I wanted to leave this information in case someone wants to give it a try.

askibinski’s picture

johnpitcairn’s picture

johnpitcairn’s picture

Issue summary: View changes

Edited to be a feature request