Wenn Pathredirect mit Pathauto kollidiert … ein Patch
Wenn man auf seiner Website das pathauto.module und das path_redirect.module betreibt, dann bekam man seit dem Update auf _path_redirect-6.x-1.0-beta6_ die folgende Fehlermeldung:
user warning: Unknown column 'path' in 'where clause' query: SELECT rid FROM path_redirect WHERE path = '<...>' LIMIT 0, 1 in /sites/all/modules/pathauto/pathauto.inc on line 74.
Der Modulautor hat bei dem Update das Tabellenfeld path in source umbenannt. Davon weiß aber das pathauto.module nichts und nimmt weiterhin das Feld path an. Der Modulautor empfiehlt nun, auf die Entwicklerversion des pathauto.module auszuweichen:
There is currently an incompatibility between Path redirect 6.x-1.0-beta6 and Pathauto 6.x-1.2. You must upgrade to Pathauto 6.x-1.x-dev version. Also, make sure to test before using on a production site. This module still is in beta after all.
Das wollte ich nun auch nicht tun, ich weiß ja nicht, was sich in der Entwicklerversion noch so geändert hat. Also habe ich mit die Fehlermeldung vor genommen und drei Zeilen in der Datei /sites/all/modules/pathauto/pathauto.inc geändert. Hier der Patch (leicht angepasst für die Webseitenbreite):
diff -u pathauto.inc{,.orig}
--- pathauto.inc 2010-01-08 22:14:57.000000000 +0100
+++ pathauto.inc.orig 2010-01-08 22:10:44.000000000 +0100
@@ -68,10 +68,10 @@
$alias_pid = db_result(db_query_range("SELECT pid FROM {url_alias}
WHERE dst = '%s' AND src <> '%s' AND language = '%s'", array($alias, $src, $language), 0, 1));
if (function_exists('path_redirect_delete')) {
// Delete from path_redirect the exact same alias to the same node.
- path_redirect_delete(array('source' => $alias, 'redirect' => $src));
+ path_redirect_delete(array('path' => $alias, 'redirect' => $src));
// If there still is this alias used in path_redirect, then create a different alias
- $redirect_rid = db_result(db_query_range("SELECT rid FROM {path_redirect} WHERE source = '%s'", $alias, 0, 1));
+ $redirect_rid = db_result(db_query_range("SELECT rid FROM {path_redirect} WHERE path = '%s'", $alias, 0, 1));
}
if ($alias_pid || !empty($redirect_rid)) {
return TRUE;
@@ -405,7 +405,7 @@
if (variable_get('pathauto_update_action', 2) == 3 && function_exists('path_redirect_save')) {
if (!empty($old_alias)) {
$redirect = array(
- 'source' => $old_alias,
+ 'path' => $old_alias,
'redirect' => $src,
);
path_redirect_save($redirect);
Ich hoffe das Problem wird sich von offizieller Seite schnell lösen. 1-2 Modulupdates werden erwartet. ;-)



Follow me!