Ticket #7281 (new defect)
Boolean value not being saved to mysql from grid.
| Reported by: | georges | Owned by: | BryanForbes |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.3 |
| Component: | DojoX Grid | Version: | 1.1.1 |
| Severity: | normal | Keywords: | mysql grid boolean |
| Cc: |
Description
There are some problems with the file : dojo1.1.1/dojox/grid/tests/support/data.php
The loop starts with the first parameter and iterates through until it finds a param with empty values. What if the value IS empty. I changed the behavior by iterating through and ending when we have tried all params from 1 to count(columns).
ALSO,
You have to convert from json true/false (or in this case <empty>) to mysql 1/0.
Here is my version:
function getPostColumns() {
$columns = getColumns(); $nCount = count($columns); $a=array(); for ($i=0; $i < $nCount; $i++) {
$p=getPostString("_".$i); $r = new stdClass(); $r->name = $columns[$i]->Field; $r->value = ($columns[$i]->Type == "tinyint(1)" ? ($p ? 1 : 0) :$p); echo "$r->name" . "<br \>"; $a[] = $r;
} return $a;
}