Hi,
Now that cakephp 3 is in alpha, i'm trying to port an app written with
cakephp 2.x.
Before the problem, i have to say that the team is doing an amazing
job...the new orm, no more array[][][] headache and much more ^^
So i have two model which are: Computers and ComputerConfigs.
The
For first level associations it is not necessary to add ['associated' =
['ComputerConfigs'] a normal save() should work.
I suggest to take a look at your Computer entity file. It should list the
field 'computer_config' in the $_accessible array. Otherwise the tampering
protection mechanism
Thank for your answer, and yes it works after checking the $_accessible var.
I baked whole project, and by default the association was hasMany and not
hasOne.
I corrected this just after baking but not $_accessible who stay with
computer_config*s* instead of computer_config.
Thank's again.
Le
Glad that it worked :)
On Monday, July 7, 2014 2:38:42 PM UTC+2, kalb...@gmail.com wrote:
Thank for your answer, and yes it works after checking the $_accessible
var.
I baked whole project, and by default the association was hasMany and
not hasOne.
I corrected this just after baking but
Hi,
let's say there are two models:
BasicEntry hasOne AdvancedEntry
AdvancedEntry belongsTo BasicEntry
In the advanced_entries table in the DB there is a field called
basic_entry_id
In views/basic_entries_edit.ctp there is something like this:
$form-input('BasicEntry.foo');
If you use the Security Component then the Form Helper will
automatically generate and manage hash fields to make sure that hidden
fields are not modified (amongst other things) (I've found it to cause
more problems than it solves, however - give it a go).
To be honest, I rarely make use of
OK, I'll have another look at the security component.
The last time I tried it, I found the same you did: it caused more
problems than it solved.
Thanks anyway.
grigri:
If you use the Security Component then the Form Helper will
automatically generate and manage hash fields to make sure
Add a hidden field containing the AdvancedEntry id to the form:
echo $form-input('BasicEntry.bacon');
echo $form-input('AdvancedEntry.id');
echo $form-input('AdvancedEntry.eggs');
(The `id` of the BasicEntry is transmitted to the edit action as the
1st parameter, so you don't need to do this
Yeah, I thought about that.
But what happens if a user changes the value of the hidden field
AdvancedEntry.id?
So I would have to check if the field has the right value. And in that
case I could just drop the hidden field.
Or am I missing something?
Regards
Guenther
grigri wrote:
Add a
Store the id in the session.
On Oct 8, 9:25 am, Günther Theilen [EMAIL PROTECTED] wrote:
OK, I'll have another look at the security component.
The last time I tried it, I found the same you did: it caused more
problems than it solved.
Thanks anyway.
grigri:
If you use the Security
10 matches
Mail list logo