Weird Save Problem

2010-10-11 Thread Dave Maharaj
I have 1 form (element) used for add / edit and a year select option: ?php echo $form-year( 'year_rec', 1980, 2010, $selected = NULL, $attributes = array ( 'label' = false, 'div' = false, 'empty' = false) );? Now when I save I end up

Re: hasOne-HABTM save problem

2010-03-05 Thread Robert P
Cake's auto-HABTM saving requires the field to be named a particular way in order to recognise it. Try naming your multiple-select field ExportDocument.ExportDocument. $list['docs'] should also be in the format array(ExportDocument.id = name) -- Varisan International http://ww.varisan.com.au/

Re: hasOne-HABTM save problem

2010-03-05 Thread Robert P
Cake's auto-HABTM saving requires the field to be named a particular way in order to recognise it. Try naming your multiple-select field ExportDocument.ExportDocument. $list['docs'] should also be in the format array(ExportDocument.id = name) -- Varisan International http://www.varisan.com.au/

Re: hasOne-HABTM save problem

2010-03-05 Thread WebbedIT
Cake's auto-HABTM saving requires the field to be named a particular way in order to recognise it. I personally get away with the as follows without issue: echo $form-input('ClassificationWhat', array('type'='select', 'multiple'='checkbox', 'options'=array($classificationWhats)); I believe the

Re: hasOne-HABTM save problem

2010-03-05 Thread murkyt
Thanks for your reply Robert. I have the $list['docs'] set up as you describe and I have tried the multiple select field as ExportDocument.ExportDocument but it seems to want to attach that data to the Sample model and not the related ExportSample model which is why I was trying

Re: hasOne-HABTM save problem

2010-03-05 Thread murkyt
Thanks for your reply Paul, I think that I am trying to get Cake to go too far down the association chain. I have tried the code you provided and it still does not save into the HABTM model. I may just have to do a manual save of the HABTM data. On Mar 5, 1:08 am, WebbedIT p...@webbedit.co.uk

Re: hasOne-HABTM save problem

2010-03-05 Thread WebbedIT
Don't go manual otherwise validation of all data before saving becomes messy. Can you debug your $this-data array in the controller and show us how the array is formatted? HTH Paul Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

hasOne-HABTM save problem

2010-03-04 Thread murkyt
I have the following relationships set up for a database of Samples. There are many different types of sample and each type has it's own set of fields so I have modelled them as Supertype/Subtypes with hasOne relationships. For an ExportSample it can have one or more documents tied to it. Sample

Model - save problem

2009-04-23 Thread Frankaube
Hi I'm new to cakephp and have problems saving my data. When calling Model-save it never saves to the databases with no errors. cake is calling describe on the table but not running any inserts after. I have no validation rules and the save function is returning TRUE. I can retreive

Re: Model - save problem

2009-04-23 Thread fain182
Hi I'm new to cakephp and have problems saving my data. When calling Model-save it never saves to the databases with no errors. cake is calling describe on the table but not running any inserts after. I have no validation rules and the save function is returning TRUE. I can retreive

Re: Model - save problem

2009-04-23 Thread Frankaube
I found the problem actually. My form in my view didn't have the same name as my model so when trying th match the fields it would'nt find any matches. Hope it helps anyone if they find this. thanks On Apr 23, 11:59 am, fain182 fain...@gmail.com wrote: Hi I'm new to cakephp and have problems

Re: Save - problem!

2008-09-09 Thread seanislegend
*bump* On Sep 8, 6:02 pm, seanislegend [EMAIL PROTECTED] wrote: I'm using the TinyMCE editor on a textarea in my CMS I'm building. A problem I've just ran into is when I add images, once saved they end up like this: 'img src=\ alt=\quot;\quot; width=258 height=318 /', obviously due to the

Save - problem!

2008-09-08 Thread seanislegend
I'm using the TinyMCE editor on a textarea in my CMS I'm building. A problem I've just ran into is when I add images, once saved they end up like this: 'img src=\ alt=\quot;\quot; width=258 height=318 /', obviously due to the way Cake treats the data before it's saved. Is there any workarounds

HABTM save problem

2008-06-10 Thread Kyle Decot
When trying to save my data, i get a 0 for team_id, but the user_id saves fine. Any thoughts of what could be wrong? $this-data['Team']['Team']['team_id'] = 303; $this-data['User']['User']['user_id'] = $this-Auth-user(id); $this-Team-create($this-data); $this-Team-save();

Save problem

2007-07-12 Thread clarkvr
Hello everybody!! I've an controler that save all my data, but adds an extra value on my table field. My controller code that make this is: if($this-Sign-save($this-data)) { $data = $this-params['data']; $num =

Re: Save problem

2007-07-12 Thread kionae
Maybe I'm just not following your logic correctly, but why are you calling save in your if statement before you process the information that you're storing in $time_data for the second save? On Jul 12, 2:21 pm, clarkvr [EMAIL PROTECTED] wrote: Hello everybody!! I've an controler that save

Re: Save problem

2007-07-12 Thread clarkvr
Sorry I'd have to show my view and my model to: view: ?php foreach($data as $field = $value): $rows = count($field); ? tr td?php echo $value['Sign']['id']?/td tdnbsp;?php echo $html-image('files/' . $value['File'] ['name']) ?/td td?php

Re: HABTM save problem

2007-04-28 Thread [EMAIL PROTECTED]
Thanks for the tip Mariano, actually I found the answer in your blog, I leave the post for the guys who might need it: http://www.cricava.com/blogs/index.php?blog=6p=192more=1c=1tb=1pb=1#more192 --~--~-~--~~~---~--~~ You received this message because you are

Re: hasMany multi-row save problem

2007-04-27 Thread Jon Bennett
hasMany´s are not saved automagically, try: if($this-Order-save($this-data)) { $order_id = $this-Order-getLastInsertId(); foreach ($this-data[´OrderDetail´] as $order_detail) { $data = array(); $data[´OrderDetail´][íd´] = null;

Re: hasMany multi-row save problem

2007-04-27 Thread Jon Bennett
sorry, it´s very early here, I meant: if($this-Order-save($this-data)) { $order_id = $this-Order-getLastInsertId(); foreach ($this-data[´OrderDetail´] as $order_detail) { $data = array(); $data[´OrderDetail´][íd´] = null;

Re: hasMany multi-row save problem

2007-04-27 Thread NOSLOW
It looks like your error message will only show if the save on the *last* order_detail fails, since $result is reset with each iteration of the loop. This action probably should use transaction processing (commit/rollback support). Also, instead of setting the id field to null in each iteration,

Re: hasMany multi-row save problem

2007-04-27 Thread Jon Bennett
It looks like your error mess sage will only show if the save on the *last* order_detail fails, since $result is reset with each iteration of the loop. This action probably should use transaction processing (commit/rollback support). it was just off-the-cuff code, merely meant to give an

HABTM save problem

2007-04-27 Thread [EMAIL PROTECTED]
Hello guys, I'm new to cakePHP and I'm trying to try a HABTM insert into database but it's not working, this is what I got: A table for users, a table for lyfestyles and a lifestyles_users table, this are my models: class User extends AppModel { var $name = 'User'; var

RE: HABTM save problem

2007-04-27 Thread Mariano Iglesias
nombre de [EMAIL PROTECTED] Enviado el: Viernes, 27 de Abril de 2007 08:23 p.m. Para: Cake PHP Asunto: HABTM save problem I'm new to cakePHP and I'm trying to try a HABTM insert into database but it's not working, this is what I got: --~--~-~--~~~---~--~~ You

hasMany multi-row save problem

2007-04-26 Thread cc96ai
I create the following structure of the data, I am able to save Order Table, however I m still unable to save Orderdetail --- Array ( [Order] = Array ( [customer_id] = 1 [user_id] = 11 ) [Orderdetail] = Array (

Re: HABTM save problem

2006-08-15 Thread ostronom
Thank you VERY much :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED]

model save problem

2006-07-14 Thread harry
In the model constructor file model_php5.php function __construct($id = false, $table = null, $ds = null) { . $this-id = $id; } $id is expected to be an integer. However, even in simple queries, an array is passed to $id, which causes some weird

Another HABTM Save Problem

2006-06-22 Thread Myk
Hi, I have 3 tables: profiles, projects and profiles_projects I have var $hasAndBelongsToMany = 'Project' on profile.php and var $hasAndBelongsToMany = 'Profile' on my project.php file. I can retrieve/query fine, but when saving, I get this error: Warning: Invalid argument supplied for

Re: Another HABTM Save Problem

2006-06-22 Thread Myk
Seems to work when data[Profile][Profile] is not in a hidden field... Strange --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To

Re: Another HABTM Save Problem

2006-06-22 Thread Myk
Found the problem... using: $html-hidden('Profile/Profile', array('value' = $this-controller-Session-read('p.id'))); doesnt work for me. I had to manually insert the profile id in the create method of my projects controller: $this-data['Profile']['Profile']['id'] = $this-Session-read('p.id');