Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
menu system
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Mar 2008 at 23:15 UTC
Updated:
16 Apr 2008 at 00:31 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
beeradb commentedsubscribe
Comment #2
boombatower commentedI think this is critical since aliases are a commonly used feature and it doesn't seem to work at all.
Comment #3
catchConfirmed here as well. You can add a path alias, and drupal_lookup_path() finds it, but viewing the node (or taxonomy term) generates a 404.
Comment #4
David_Rothstein commentedI checked the CVS logs and it seems this was caused by http://drupal.org/node/196862 (I confirmed that reversing the patch there makes the problem go away).
However, I don't think that patch is the ultimate cause of the problem. I think it's actually a deeper problem having to do with the module_list() function, which just happened to be exposed by that patch.
For example, here is a patch that (at least for me) makes the URL aliases work again. It's definitely NOT the right thing to do in the long run! But it's a starting point for a fix, and a demonstration that some weirdness with module_list() seems to be the ultimate cause of this bug...
Comment #5
David_Rothstein commentedIn particular, there seem to be two problems with module_list():
1. It does its internal caching in a rather odd way, by storing everything in the same static $list variable (regardless of what type of module list it is generating; e.g.
$bootstrap = TRUEorFALSE). This means that when you call it normally (without asking it to do a refresh), it returns whatever module list it happened to generate last time, which is not necessarily the list you wanted!2. For the life of me I can't figure out why
$bootstrap = TRUEis the default value for this function...Basically, I think the combination of the above two problems is what leads to this bug. The issue referenced above added a
module_exists('path')check, which evidently occurs at the right place in the sequence to trigger this problem. The check winds up being done against the wrong list of modules and erroneously returns FALSE, thereby causing URL aliases never to happen.Comment #6
Anonymous (not verified) commentedI'm marking this as duplicate with #222109: module_list() should be rewritten as 2 functions: module_list() and module_list_bootstrap(). The patch at #4 in this issue isn't appropriate because the module_list cache becomes useless with it. We can take care of the $bootstrap default value in #222109: module_list() should be rewritten as 2 functions: module_list() and module_list_bootstrap().
Comment #7
David_Rothstein commentedSure, sounds reasonable -- after all, the other issue is older. And yup, I know the patch in #4 isn't good... that's why I marked it "code needs work"! ;) As I said, it was just a quick demonstration to show that module_list()'s caching is the root cause of the problem, not an actual fix.
I'll continue discussion at the other issue.