From b06120b7272f31b715fdec90f12e1a02956cdca2 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Mon, 29 Mar 2010 15:46:25 -0400 Subject: [PATCH] db_reposition(): fixed error messages --- db.php | 2 +- unit_tests/db.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db.php b/db.php index 4650cb5..c93e5f3 100644 --- a/db.php +++ b/db.php @@ -394,7 +394,7 @@ function db_reposition_respace($table, $field) { # $pretty is used in error messages to refer to the row, it defaults to whatever you pass for $table. function db_reposition($table, $row_id, $new_pos, $field = 'ord', $pretty = 'same as $table', $renumbered_already = false) { - if($pretty = 'same as $table') { + if($pretty == 'same as $table') { $pretty = $table; } diff --git a/unit_tests/db.php b/unit_tests/db.php index a2aeb1b..4906f1b 100644 --- a/unit_tests/db.php +++ b/unit_tests/db.php @@ -68,7 +68,7 @@ function test_db_reposition() { foreach($args as $arg_str) { list($src, $dest, $space, $c1, $c2, $c3) = str_split($arg_str); - $ord = db_reposition($table, $before[$src], $dest); + $ord = db_reposition($table, $before[$src], $dest, 'ord', 'test record'); db_update($table, 'ord', $ord, 'where id=%i', $before[$src]); $after = db_get_column($table, 'id', 'order by ord'); $ords = db_get_column($table, 'ord', 'order by ord'); -- 1.7.10.4