When no url_alias rows is present in db upon start of request, the static $count is set to '0', and the 'wipe' does not clear this state.
Steps to reproduce:
1.) clear url_alias cache
2.) create some code that does:
a.) sets an alias using path_set_alias()
b.) get the alias back, using drupal_get_path_alias()
The alias returned will be wrong, even though path_set_alias() calls drupal_clear_path_cache() (which just calls the drupal_lookup_path('wipe')).
Cause: the $count is not reset upon wipe.
The above issue gives me problems with creation of nodes during when using an installation profile.
Comments
Comment #1
gielfeldt commentedHere's a patch that fixes the problem.
Comment #2
dave reidYou should just use unset($count). And this should probably be fixed in D7, then backported.
Comment #3
dave reidPatch for D7.
Comment #4
Anonymous (not verified) commentedOk.
Comment #5
damien tournoud commentedSince when can we unset static variables?
This probably doesn't work, and anyway, it should have a test.
Comment #6
Anonymous (not verified) commentedWhich means that if the unset is at the top of the function then it works well. Setting $count to NULL instead would work for this case.
Comment #7
damien tournoud commentedHere is a proper patch.
#204106: Test for translated path aliases now depends on this.
Comment #8
dries commentedI've committed this to CVS HEAD and DRUPAL-6. Thanks!
Comment #9
gpk commentedComment #10
marcingy commentedMarking as won't fix as d5 is end of life.