Cakephp Enregistrer avec une table où la clé primaire n'est pas 'id'

J'ai une application web existante que je suis la conversion à utiliser CakePHP.
Le problème est que les clés primaires pour la plupart des tableaux sont dans ce format "${table_name}_id" (story_id) au lieu de la CakePHP façon de 'id'

Lorsque j'ai jamais essayer de mettre à jour certains des champs d'une ligne dans l'histoire de la table, la Save() de la fonction retournera false. Est-il possible d'obtenir une vue plus détaillée de rapport d'erreur à partir de la Save() de la fonction. ?

Lorsque j'ai mis Configure::write('debug', 2); dans core.php et vérifiez les instructions SQL je ne vois pas la commande de mise à JOUR, seuls les instructions SELECT.

J'ai essayé de modifier le contrôleur de l'ajout de la ligne suivante pour définir manuellement le champ id pour le contrôleur, mais il n'a pas aidé.

$this->Story->id = $this->data['Story']['story_id'] ; 

Je suis à cours d'idées. Toutes les suggestions?

J'ai inclus le code source que j'utilise ci-dessous

Histoire contrôleur:

 function admin_edit($id = null) 
 {
  if (!$id && empty($this->data)) {
   $this->Session->setFlash(__('Invalid '. Configure::read('Site.media') , true));
   $this->redirect(array('action'=>'index'));
  }

  $this->layout = 'admin';  
  if (!empty($this->data)) {
   if ($this->Story->save($this->data)) {
    $this->Session->setFlash(__('The '. Configure::read('Site.media') .' has been saved', true));
   } else {
    $this->Session->setFlash(__('The '. Configure::read('Site.media') .' could not be saved. Please, try again.', true));
   }
  }

  $this->data = $this->Story->read(null, $id );
 }

Histoire modèle:

class Story extends AppModel {
    var $name = 'Story';
    var $primaryKey = 'story_id';

    var $validate   = array(
       'author_id'  => array('numeric'),       
       'title'   => array('notempty'),
       'story'   => array('notempty'),
       'genra'   => array('notempty'),
       'form'    => array('notempty'),  
       'wordcount'  => array('Please enter a number between 1 and 1000' => array( 
              'rule'   => array('range', 1, 1001),
              'message'  => 'Please enter a number between 1 and 1000' ),
              'Required'  => array( 'rule' => 'numeric', 'required' => true )
            )
    );

    //The Associations below have been created with all possible keys, those that are not needed can be removed
    var $belongsTo = array(
     'Author' => array(
      'className' => 'Author',
      'foreignKey' => 'author_id'
     )
    );

    var $hasMany = array(
     'UserNote' => array(
      'className' => 'UserNote',
      'foreignKey' => 'story_id',
      'dependent' => false,
      'conditions' => 'UserNote.notes != ""'
     )
    );
}

Histoire vue:

    echo $form->create('Story', array('action' => 'edit' ) );
    echo $form->input('story_id',array('type'=>'hidden') );
    echo $form->input('title');
    echo $form->input('story');
    echo $form->input('bio' );
    echo $form->end('Update story details');?>

Histoire de la table

CREATE TABLE IF NOT EXISTS `stories` (
  `story_id` int(11) NOT NULL AUTO_INCREMENT,
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `closed` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `author_id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `story` text NOT NULL,
  `genra` varchar(255) NOT NULL,
  `form` varchar(128) DEFAULT NULL,
  `wordcount` varchar(255) NOT NULL,
  `terms` varchar(255) NOT NULL DEFAULT '0',
  `status` varchar(255) NOT NULL DEFAULT 'slush',
  `published` date NOT NULL,
  `payment` varchar(255) NOT NULL DEFAULT 'none',
  `paypal_address` varchar(255) NOT NULL,
  `resubmission` tinyint(1) NOT NULL DEFAULT '0',
  `bio` text NOT NULL,
  `password` varchar(255) NOT NULL DEFAULT 'yyggrrdd',
  `comments` text NOT NULL,
  PRIMARY KEY (`story_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=10905 ;