#5919: same fields in different models lead to unexpected behaviour using
formhelper
----------------------------------+-----------------------------------------
    Reporter:  e0827543           |          Type:  Bug    
      Status:  new                |      Priority:  High   
   Milestone:  1.2.x.x            |     Component:  Helpers
     Version:  RC4                |      Severity:  Normal 
    Keywords:  formhelper, types  |   Php_version:  n/a    
Cake_version:                     |  
----------------------------------+-----------------------------------------
 Imagine you have to models, e.g. Post and Tag
 Each Post and Tag have both field named "title", but Post.title is text,
 and Tag.title is varchar(100). Using FormHelper to output both fields
 without defining the type of the fields manually would expect to show a
 textarea and an input type text field.


 {{{
 <?php
 $form->create('Post');
 //debug($form->fieldset);
 echo $form->input('Tag.title');
 echo $form->input('Post.title');
 echo $form->end();
 ?>
 }}}

 But depending on with which model the form is created, field types from
 this specific Model are cached without the model name. So executing the
 lines above leads to unexpected behaviour because two text fields or two
 textareas are shown, depending on whether using $form->create('Post') or
 $form->create('Tag').

 This bug is very, very bad because if existing SQL Tables are only
 extended in the database (e.g. add a field which exists in one other
 table), existing and tested forms may change.

-- 
Ticket URL: <https://trac.cakephp.org/ticket/5919>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design 
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. 
Our primary goal is to provide a structured framework that enables PHP users at 
all levels to rapidly develop robust web applications, without any loss to 
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tickets cakephp" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---

  • [CakePHP : The Rapid Dev... CakePHP : The Rapid Development Framework for PHP

Reply via email to