<div>As an API, I think it should return all aliases of a path or should take an additional parameter like 'all','latest','oldest' depending on how you want it. But yeah it returns the oldest alias and just one entry. </div>
<br clear="all">Dipen Chaudhary<br><a href="http://www.dipenchaudhary.com">http://www.dipenchaudhary.com</a><br><a href="http://playdrupal.com">http://playdrupal.com</a><br><br><br>
<br><br><div class="gmail_quote">On Thu, Feb 19, 2009 at 3:49 AM, Nir Aides <span dir="ltr"><<a href="mailto:nir@winpdb.org">nir@winpdb.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div dir="ltr">Hi,<br><br>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.<br>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?<br>
<br>Is this a bug?<br><br>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"<br>
<br>Also, shouldn't this be db_result(db_query_range()) instead of just db_result(db_query())?<br><br>Nir<br></div>
</blockquote></div><br>