Currently there is an API difference between the $redirect variable returned from path_redirect_load() and the one used by path_redirect_save(). This causes redirects to not save properly because of a MySQL error when trying to do something like the following:

$redirect = path_redirect_load(1);
path_redirect_save($redirect);

You receive the error:

Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in db_escape_string() (line 321  of /Users/nate/Sites/drupal6/includes/database.mysql.inc).

And the update fails when trying to put an array into a string placeholder.

This patch makes these two functions work better with each other, just by converting query arrays back into strings before doing the update.

CommentFileSizeAuthor
path_redirect_load_save.patch747 bytesquicksketch

Comments

dave reid’s picture

Status: Needs review » Fixed

Committed with another fix for loading cleanup in http://drupal.org/cvs?commit=432338

Thanks Nate!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.