Dear CakePHP users,

I built a form which worked fine, up until I installed the CakePHP
Tags Plugin from CakeDC. Since that plugin started working, my Form-
>year() input returns Array, instead of an integer. Does anyone have
any idea how this could happen?

My form code is as follows:

    echo $this->Form->create('Story', array('action' => 'add'));
    echo $this->Form->input('title', array('label' => 'Titel:'));
    echo $this->Form->input('body', array('label' => 'Jouw verhaal:',
'rows' => 15, 'cols' => 60));
    echo $this->Form->label('', 'In welk jaar speelde dit verhaal?');
    echo $this->Form->year('year', 1920, date('Y'), 1950);
    echo $this->Form->input('tags');
    echo $this->Form->input('school_id', array('value' => $school,
'type' => 'hidden'));
    echo $this->Form->input('user_id', array('value' => 1, 'type' =>
'hidden'));
    echo $this->Form->end('Verstuur');

When I submit the form, this is the error I receive:

Notice (8): Array to string conversion [CORE/cake/libs/model/
datasources/dbo_source.php, line 749]
Warning (512): SQL Error: 1054: Unknown column 'Array' in 'field
list' [CORE/cake/libs/model/datasources/dbo_source.php, line 684]
Query: INSERT INTO `stories` (`title`, `body`, `year`, `tags`,
`school_id`, `user_id`, `modified`, `created`) VALUES ('dfgfg',
'fgdgdgdfg', Array, 'werk', 1, 1, '2011-03-21 04:09:01', '2011-03-21
04:09:01')

As you can see, the value for 'year' is 'Array'... I have no idea
where this is coming from, but the form works when I comment the line
that creates the year input.

Any help would be greatly appreciated!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to