Postponed (maintainer needs more info)
Project:
Link
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
31 Aug 2011 at 15:26 UTC
Updated:
12 Jul 2013 at 10:20 UTC
Can Internal link paths are be validated to see if they actually exist?
Comments
Comment #1
nmc commentedComment #2
dqdhm, 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?
Comment #3
nmc commentedI 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?)Comment #4
dqdhm ,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.
Comment #5
anrikun commentedHi, 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.
Comment #6
askibinski commentedrelated: #1370926: Having autocomplete for internal links
Comment #7
johnpitcairn commentedSee CKEditor Link widget
Comment #7.0
johnpitcairn commentedEdited to be a feature request