Posted by kunago on May 3, 2011 at 11:08am
1 follower
| Project: | Path Filter |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
The module did not cooperate with internationalization module.
if (module_exists('i18n')) {
if ($path = drupal_get_normal_path($matches[3])) {
if (substr($path, 0, 5) == 'node/') {
$nid = substr($path, 5);
}
}
elseif (preg_match('/(node\/([0-9]+))$/', $matches[3], $match)) {
$nid = $match[2];
}
if (!empty($nid)) {
$languages = language_list('enabled');
$languages = $languages[1];
if (isset($language)) { $url_array['language'] = $languages[i18n_node_get_lang($match[2])];}
$link = url($match[1], $url_array);
}
}If the first condition passed properly (via drupal_get_normal_path) the second part of the function did not trigger and I got some errors. I changed the function not to use the $match variable and use directly the discovered $nid with "node" prefix.
Also the function i18n_node_get_lang in the latest i18n version uses an obsolete function and results in WSOD with an error. The proper patch is here: #1144914: Node get language cannot use db_result() function.
This thread was created as a follow-up of the thread #945512: Drupal 7 port.
| Attachment | Size |
|---|---|
| pathfilter.module.diff | 762 bytes |