#6066: [TEST][PATCH] Model->create with filterKey does not unset audit fields
    Reporter:  GreyCells                       |         Owner:  
        Type:  Bug                             |        Status:  assigned       
    Priority:  Low                             |     Milestone:  1.2.x.x        
   Component:  Model                           |       Version:  1.2 Final      
    Severity:  Normal                          |    Resolution:                 
    Keywords:  model create filterKey created  |   Php_version:  n/a            
Cake_version:  8015                            |  
Comment (by mariano.iglesias):

 Eventhough the patch seems correct, I see no reason why this should be
 done at the core level. If you are using $filterKey with the intention of
 cloning records, you can just as easily do:


 $data = array('Article' => array_diff_key($data, array('created' => true,
 'updated' => true, 'modified' => true)));

 $this->Article->create($data, true);


 So I'll be closing this ticket with a test case to show it

Ticket URL: <https://trac.cakephp.org/ticket/6066#comment:2>
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 
You received this message because you are subscribed to the Google Groups 
"tickets cakephp" group.
To post to this group, send email to tickets-cakephp@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to