Please, see attached patch. It's simple, but also pretty handy.

CommentFileSizeAuthor
path.module_2.patch911 bytesmarkus_petrux

Comments

dries’s picture

Status: Needs review » Needs work

Should use get_base() instead of a global.

markus_petrux’s picture

There's a function to return $base_path, base_path(). But there isn't to return $base_url.

Do you mean, there should be a function get_base() to return $base_url? If so, this is a too big change for me, I believe.

markus_petrux’s picture

I was just reviewing issues...

Dries, there is no such a function. Maybe if one has to be implemented, then is it enough creating the function? ...or every instance of $base_url should be changed to get_base() in core modules?

Though, here are several places where $base_url is used (this is something that comes from 4.6 so there may be modules...). This issue was just about a simple idea to add something useful to admin/path... ie. turn paths into links... does that worth?

Should the implementation of get_base() be dealt from this issue?

Steven’s picture

Prefixing with the base_url to force out the unaliased path is unsupported and buggy. It will not work for unclean URLs for example.

Why do we need to link to the unaliased path anyway? The resulting page is by definition identical to the one you get from the aliased path.

markus_petrux’s picture

Providing a link for unaliased path would allow you to easily check if it really points to a valid path.

Please confirm so I can reroll the thing properly. Thanks

Jaza’s picture

I don't think this feature is necessary. 99% of users will have no desire to check whether or not the unaliased path resolves: they will simply trust that Drupal is stable and that it works, or they might not care if it resolves at all. The other 1% of users can check this by manually typing in the URL of the unaliased path.

Also, for the 99% of users in the first category, this feature will only serve to confuse.

markus_petrux’s picture

I just found the need to check URLs due to bugs in pathauto module. Hence the idea.

I no one else see this feature useful, I'll mark the issue as won't fix the next time I revisit it... don't hesitate to do it right now, if you wish.

markus_petrux’s picture

Status: Needs work » Closed (won't fix)
markus_petrux’s picture

I ended up implementing this feature as a contrib module. It's available here, if anyone wishes to take a look:

http://www.phpmix.org/projects/drupal

In addition to render paths as links, it attempts to identify broken aliases. The alias checker is something that may need more work, but it has an option that allows you to flag aliases as 'known' by using regular expressions. Yep! This is an experiment, but I needed to check a site with a lot of content and it saved me some time...

If you wish to comment on anything about it, please use my forums (follow the support link in the module page). I'm very busy these days and hardly monitor Drupal for news et al. Thanks