The problem is in nodeaccess_password_403()
...
if (arg(0, $path) != 'node' || !is_numeric(arg(1, $path))) {
$path = drupal_lookup_path('source', $path);
}
if (arg(0, $path) == 'node' && is_numeric(arg(1, $path))) {
...
I think drupal_lookup_path() needs to get propper language code and 'node' (in second if statement) is not fisrt argument on multilangual sites.
New options in $path are e.g.:
- /en/aliased/path
- /en/node/[nid]
- /cs/aliased/path
- /cs/node/[nid]
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 403_form_not_shown_for_localized_URLs-2045497-1.patch | 636 bytes | jiri.dzuba |
Comments
Comment #1
jiri.dzuba commentedPatch for nodeaccess_password.403.inc. Rewriting a condition for checking prefix multilangual sites.
Comment #2
radimklaskaI tested the patch in #1 and it looks OK to me. But @jiri.dzuba is my coworker, so I'm kind of biased. :)
PS: @jiri.dzuba Congrats to first post and first patch on d.o! :)
Comment #3
radimklaskaI took a second look and found some space to improve the patch.
1) We should replace
str_replacewithpreg_replaceand delete the prefix only if it is at the beginning of an URL.2)
if (module_exists('i18n')) {andi18n_language_context()isn't the best - you can have language prefixed URLs without i18n module. (Rare, but possible.)Comment #4
radimklaskaAlso we should probably use drupal_get_normal_path() https://api.drupal.org/api/drupal/includes!path.inc/function/drupal_get_... instead of drupal_lookup_path().
Comment #5
Adrenaline-2 commentedHi, im not sure if this is the right place to bring up this issue im having...
I made this module work once, and after rebuilding the permissions it stopped working,
-> When an anonymous user tries to get on the basic page i added (with the password), they dont get redirect to the access denied page, instead they end up with a white page.... any idea why this could happen?
Comment #6
radimklaska@Adrenaline are you using the patch from #1?
EDIT: Is your site multilingual?