[TYPO3-mvc] How to use f:form.checkbox

Axel Müller axel.mueller at amit-services.de
Sun Nov 29 20:49:40 CET 2009


Hi,
> i do not get the viewhelper f:form.checkbox to work...
me too. Maybe there is a Problem with boolean Attributes in Models:

in Tx_Exbase_Property_Mapper::transformToObject

if I check the Checkbox I get via t3lib_div::debug($propertyValue)

-------------------------
__identity  |	38
raum 	|   Raum 8
adresse |   irgendwo
ort 	|  irgendwo
erreichbarkeit 	| ja
barrierefreiheit   |	1
-------------------------

if I uncheck it I get:

-------------------------
__identity  |	38
raum 	|   Raum 8
adresse |   irgendwo
ort 	|  irgendwo
erreichbarkeit 	| ja
-------------------------

the boolean "barrierefreiheit", switched via the checkbox isn't in the
array.

some lines later Tx_Exbase_Property_Mapper::transformToObject:

258            } elseif (is_array($propertyValue)) {
259                 if (isset($propertyValue['__identity'])) {
260                     $existingObject =
$this->findObjectByUid($targetType, $propertyValue['__identity']);
261                     if ($existingObject === FALSE) throw new
Tx_Extbase_Property_Exception_TargetNotFound('Querying the repository for
the specified object was not successful.', 1    237305720);
262                     unset($propertyValue['__identity']);
263 
264                     if (count($propertyValue) === 0) {
265                         $propertyValue = $existingObject;
266                     } elseif ($existingObject !== NULL) {
267                         $newObject = clone $existingObject;


in this line, the existing array_keys get mapped, but barrierefreiheit
isn't a key in propertyValue and therefore isn't changed. Am I wrong? It's
late...

268                         if ($this->map(array_keys($propertyValue),
$propertyValue, $newObject)) {
269                             $propertyValue = $newObject;
270                         }
271                     }
272  

greetings,
Axel

-- 
axel.mueller at amit-services.de
http://www.amit-services.de
tel (06322) 680 668
mobil 0160 973 483 27
gpg-id: AADE7CDF
jabber-id: axelm at jabber.ccc.de


More information about the TYPO3-project-typo3v4mvc mailing list