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
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/
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/
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
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
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
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.
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
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
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
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
*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
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
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();
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 =
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
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
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
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;
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;
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,
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
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
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
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
(
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]
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
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
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
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');
30 matches
Mail list logo