JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
db_reposition(): fixed error messages
authorJason Woofenden <jason@jasonwoof.com>
Mon, 29 Mar 2010 19:46:25 +0000 (15:46 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Mon, 29 Mar 2010 19:46:25 +0000 (15:46 -0400)
db.php
unit_tests/db.php

diff --git a/db.php b/db.php
index 4650cb5..c93e5f3 100644 (file)
--- 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;
        }
 
index a2aeb1b..4906f1b 100644 (file)
@@ -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');