thx for your answers

absolutly positive - adding the default value again everything is
fine.
the white screen i get them sometimes in connection with security
component,
and after some testing, it IS the security component.

@RichardAtHome:
the thing is, there are no logs at all! empty.. with debug = 2

and i think i know what is causing it.
the checkboxes have their "hidden" input field for a certain purpose.
for Cake (and its security component) mainly to recognize it as a
transfered form element.
as checkboxes (as well as my radio buttons) do not post any value at
all if not selected

so the radio buttons dont have any hidden fields - therefore
submitting a form with unselected radio
buttons
a) validation will not work on them (as cake thinks they are not
present in this form)
this is important to know - as it can cause major problems if the
content of the radio buttons triggers some things later on.
i had validation of some other fields linked to the selection of the
radio buttons. well, the problem now was, that none of them were
triggered.
so i had a bunch of "unvalidated" rows inserted into the database.
quite a security issue on some places maybe.
b) white screen of death with the security component, as the hash
value created for the form field (with the radio group) does not match
the
transmitted fields anymore. that was the problem i pointed out above.

What i did learn:
NEVER use radio buttons without hidden field for the default value
(hope this gets into cake core some time)
use a dummy default (as i did), or chose one of the existing ones as
default value.


One Question:

How can i use the Core Security Component without these white screens?
As pointed out above, no error logs, nothing.
this is not very convinient at all..

maybe some point there is a die() function invoked
but i would like to get a "normal" error page with a message - and not
just a dieing cake app :)




On 27 Aug., 11:17, RichardAtHome <[EMAIL PROTECTED]> wrote:
> What tram said... change the field to an Int. Mysql tinyint datatype
> has traditionally been used to store boolean data as MySQL doesn't
> have a boolean datatype.
>
> Alternatively, use a 1 byte char field.
>
> Or change your options to be
> null = Pending (the database default)
> 0 = Disapprove
> 1 = Approve
>
> Or use an enum. Note: enums are mysql specific and are not directly
> supported by cake. This doesn't mean you can't use them though (cake
> treats them as a standard varchar field). There are some behaviours
> out there that can help with enums.
>
> As to the white screen of death, check out the httpd error logs and
> the cake error logs (app/tmp/logs/error.log)
>
> On Aug 26, 11:45 pm, [EMAIL PROTECTED] wrote:
>
> > oh cmon you dont expect good anwers when you're bashing the fw like that ?
>
> > cake interprets int(1) as bool , its a design choice. you are welcome
> > to update the book.cakephp.org to reflect that.
>
> > "white screen of death" - sorry im not getting it with your code, you
> > sure the radio call is causing it ?
>
> > On 8/27/08, Mark (Germany) <[EMAIL PROTECTED]> wrote:
>
> > > oh my gosh....
> > > cake again.. typical
>
> > > by using TINYINT(1) it is assumed that you have a checkbox toggle with
> > > 0 and 1 as values i guess.
> > > anyway, after changing it to TINYINT(2), this automagic correction is
> > > no longer active
> > > and my value now is -1 in the Database
> > > Where in the documentation did i miss that?
>
> > > Are there more of these automatic corrections where a normal cake user
> > > would not assume it?
>
> > > PS: about the white screen of death - anyway - are there any solutions
> > > to it?
> > > other than having to use a dummy "default"?
>
> > > thx mark
>
> > > On 26 Aug., 23:37, "Mark (Germany)" <[EMAIL PROTECTED]>
> > > wrote:
> > >> Well - CakePHP and Rapid Development can be two things that dont get
> > >> along with each other sometimes.. :)
> > >> i try for hours now...
>
> > >> first of all if you do not set a default value cake crashes completely
> > >> - white screen of death all of the sudden:
> > >> $form->input('status',array('type'=>'radio','options'=>array(1=>Disapprove',
>
> > >> 1=>'Approve'),'legend'=>false));
>
> > >> so i was forced (i really hate that - if i am forced to workaround
> > >> something) to add a dummy "pending" one:
> > >> $form->input('status',array('type'=>'radio','options'=>array(0=>'Pending',-1=>Disapprove',
>
> > >> 1=>'Approve'),'legend'=>false));
>
> > >> ok, so far so good, but
>
> > >> in the second code sample (i tried with both integer -1 0 1  and '-1'
> > >> '0' '-1'), the -1 always gets changed to 1 when saved to the database
> > >> - i debugged it and found out, that it is (inside of $this->data)
> > >> still -1 after validation and - i did not believe it - after having
> > >> saved the fields. so cake transformes it wrongly or something when
> > >> saving it.
>
> > >> the DB table setting is:
> > >> `status` tinyint(1) NOT NULL default '0' COMMENT '-1 dissap. 1
> > >> approved',
> > >> so neg. values should be no problem...
>
> > >> and the query clearly shows that it is cake's "fault":
> > >> UPDATE `role_applications` SET `id` = 2, `status` = 1, `check_text` =
> > >> 'somehting', `adminonly_text` = 'whatever', `checked_by` = 1,
> > >> `check_date` = '2008-08-26 23:34:29' WHERE `role_applications`.`id` =
> > >> 2
>
> > >> anyone an idea what is going on?
> > >> how can i use negative values for radio buttons then?
>
> > >> if this goes on, i wont have any project done by the end of next
> > >> year..
> > >> mark
>
> > --
> > Marcin Domanskihttp://kabturek.info
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to