diff options
author | Andy Staudacher <andy.st@gmail.com> | 2010-01-20 23:12:36 -0800 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2010-01-20 23:12:36 -0800 |
commit | 6dd92cfa1cbdade77721f153aa1b6aab965cff82 (patch) | |
tree | 282ad33216dd712b0f2bceabcb74734f863e0e34 | |
parent | 9384f987bb96d0d39787ff9d3d16a70c01cd76e0 (diff) |
Fix maintenance tasks / language admin for bug introduced earlier by no longer casting in ORM.
Task->done is now a string, boolean false is stored as integer 0 and loaded as string "0". On the client side that's interpreted as truthy in JavaScript.
Fix: cast "0" to (bool) before encoding to JSON.
-rw-r--r-- | modules/gallery/controllers/admin_maintenance.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gallery/controllers/admin_maintenance.php b/modules/gallery/controllers/admin_maintenance.php index 213e4fe2..aa4fb29f 100644 --- a/modules/gallery/controllers/admin_maintenance.php +++ b/modules/gallery/controllers/admin_maintenance.php @@ -216,7 +216,7 @@ class Admin_Maintenance_Controller extends Admin_Controller { "task" => array( "percent_complete" => $task->percent_complete, "status" => $task->status, - "done" => $task->done), + "done" => (bool) $task->done), "location" => url::site("admin/maintenance"))); } else { @@ -224,7 +224,7 @@ class Admin_Maintenance_Controller extends Admin_Controller { "task" => array( "percent_complete" => $task->percent_complete, "status" => $task->status, - "done" => $task->done))); + "done" => (bool) $task->done))); } } } |