[development] My first post: path_set_alias() and multiple aliases

Earnie Boyd earnie at users.sourceforge.net
Thu Feb 19 12:44:12 UTC 2009


Quoting Nir Aides <nir at winpdb.org>:

> Hi,
>
> path_set_alias($path, $alias) inserts a new alias in case there is already
> an alias for $path. However drupal_lookup_path() keeps picking up the old
> alias.
> It makes sense to keep the old alias so links don't break in a website, but
> why look up the old alias when generating a URL?
>
> Is this a bug?
>

You should review the issue queue.  I know that there are issues 
related to path_set_alias.

> Shouldn't the query "SELECT dst FROM {url_alias} WHERE src = '%s' AND
> language IN('%s', '') ORDER BY language DESC" in drupal_lookup_path() be
> rewritten as "SELECT dst FROM {url_alias} WHERE src = '%s' AND language
> IN('%s', '') ORDER BY language DESC, pid DESC"
>
> Also, shouldn't this be db_result(db_query_range()) instead of just
> db_result(db_query())?
>

I don't find this query in drupal_lookup_path for D6 or D7.  The query 
should have a LIMIT 1 at least since db_result is only returning the 
first row.

--
Earnie  http://r-feed.com
  Make a Drupal difference and review core patches.

-- http://for-my-kids.com/  -- http://give-me-an-offer.com/



More information about the development mailing list