saveall on habtm creates duplicate new rows

2015-06-10 Thread ajt
Hi, I have a simple HABTM with a lessons/Students table. i simply create a new lesson with an existing student via a while loop , so I should get 2 new rows. I am testing this function. What I get is 4 new rows in the lesson table instead of 2. I have no idea why the extra 2 rows are created

saveAll and HABTM

2009-06-26 Thread Javier
Here's my problem, i have something like this in my DB: A hasMany B B HABTM C I have a page to edit A and B at the same time, I can add or edit multiples instances of B to A using a saveAll, but i don't know how to manage relations with model C. The only way i've found if, after doing the

relationships not deleting on saveAll with HABTM

2008-12-23 Thread tekomp
Hi, I have a form which is saving data to a join table using the method found here: http://teknoid.wordpress.com/2008/09/24/saving-extra-fields-in-the-join-table-for-habtm-models/ The data saves, but each time I submit the form, it doesn't delete the existing relationships in the join table

Re: relationships not deleting on saveAll with HABTM

2008-12-23 Thread tekomp
I was using non-automagical form fields on my form, and because of that, this was left out: input type=hidden name=data[Niche][Niche] value= id=NicheNiche / Once I put that in there, it worked fine. On Dec 23, 6:37 am, tekomp btisch...@gmail.com wrote: Hi, I have a form which is saving

Re: saveAll() and HABTM

2008-12-16 Thread WebbedIT
Try a recent svn checkout of the 1.2 branch. It should be fixed there I downloaded model.php and model.test.php from https://trac.cakephp.org/changeset/7789 And uploaded them over my RC3 versions of the files. Is it OK to do this files without updating any of the rest of the files?

saveAll() and HABTM

2008-12-15 Thread WebbedIT
I am working with the following models: Scheme belongsTo Organisation HABTM SchemeService Organisation hasOne Scheme SchemeServices HABTM Scheme $this-Scheme-save($this-data) saves my Scheme and SchemeServices (HABTM) no problem, but I then have to call an extra save for $this-

Re: saveAll() and HABTM

2008-12-15 Thread WebbedIT
Anyone? I have done searching of this group and it seems there was a bug in 1.2 that was fixed ... so I guess I'm doing something wrong but if the array is fine using save() then why not work when using saveAll ()? --~--~-~--~~~---~--~~ You received this message

Re: saveAll() and HABTM

2008-12-15 Thread mark_story
Try a recent svn checkout of the 1.2 branch. It should be fixed there. -Mark On Dec 15, 3:31 pm, WebbedIT p...@webbedit.co.uk wrote: Anyone?  I have done searching of this group and it seems there was a bug in 1.2 that was fixed ... so I guess I'm doing something wrong but if the array is

Re: saveAll and HABTM?

2008-04-29 Thread avairet
Hi Aaron, I re-read my old messages... My data array seems to look like your example... But neither Model1-saveAll() or Model2-saveAll() seems to work! In my case and standing for Model::saveAll() enhancement or new function, I make a Model1-save($this-data) which save my main model and its

Re: saveAll and HABTM?

2008-04-08 Thread aaron bauman
I have noticed this behavior as well. It's because in Model::saveAll, the call to Model::save uses this- data[$this-alias] instead of $this-data. therefore if you have a data array that looks like array( 'Model1' = array(data) 'Model2' = array(data) ) and you call Model1-saveAll, guess what?

saveAll and HABTM?

2008-04-03 Thread avairet
Hi, I'm using nightly builds from 1.2.x.x branch. My main model Item have this associations: Item hasOne Article Item hasOne Photo Item hasAndBelongsToMany Tag ... In a form I have these fields : data['Item']['id'] (it's results on a form input TEXT) data['Item']['title'] (it's results on a