#6014: Checkbox helper doesn't work correctly with Aro Aco values
--------------------------------+-------------------------------------------
Reporter: lf234662 | Owner:
Type: Test Case | Status: new
Priority: Medium | Milestone: 1.2.x.x
Component: Helpers | Version: 1.2 Final
Severity: Normal | Resolution:
Keywords: checkbox helper | Php_version: PHP 5
Cake_version: |
--------------------------------+-------------------------------------------
Comment (by lf234662):
Here some few lines of code to reproduce the bug :[[BR]]
In my controller :[[BR]]
I inject these kind ok values in $this->data : [[BR]]
{{{
Array
(
[ADMDEL] => Array
(
[read] => 1
[create] => -1
[update] => -1
[delete] => -1
)
[ADMGAL] => Array
(
[read] => 1
[create] => 1
[update] => 1
[delete] => 1
)
[ANONYM] => Array
(
[read] => 1
[create] => -1
[update] => -1
[delete] => -1
)
)
}}}
And set the variable $this->set('listeProfil', $tmpListeProfil)[[BR]]
With $tmpListeProfil :[[BR]]
{{{
Array
(
[0] => Array
(
[Profil] => Array
(
[id] => 28
[code] => ADMDEL
[libelle] => Administrateur délégué
)
)
[1] => Array
(
[Profil] => Array
(
[id] => 25
[code] => ADMGAL
[libelle] => Administrateur général
)
)
[2] => Array
(
[Profil] => Array
(
[id] => 15
[code] => ANONYM
[libelle] => Anonyme
)
)
)
}}}
In my view I play this loop :[[BR]]
{{{
foreach($listeProfil as $ligne => $obj) {
echo $form->checkbox($obj['Profil']['code'].'.read');
echo $form->checkbox($obj['Profil']['code'].'.create');
echo $form->checkbox($obj['Profil']['code'].'.update');
echo $form->checkbox($obj['Profil']['code'].'.delete');
}
}}}
The result sould be :[[BR]]
checked unchecked unchecked unchecked[[BR]]
checked checked checked checked[[BR]]
checked unchecked unchecked unchecked
--
Ticket URL: <https://trac.cakephp.org/ticket/6014#comment:2>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC.
Our primary goal is to provide a structured framework that enables PHP users at
all levels to rapidly develop robust web applications, without any loss to
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"tickets cakephp" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---