From: Jason Woofenden Date: Mon, 29 Mar 2010 19:46:25 +0000 (-0400) Subject: db_reposition(): fixed error messages X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=commitdiff_plain;h=b06120b7272f31b715fdec90f12e1a02956cdca2 db_reposition(): fixed error messages --- 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');