Skip to content

Commit

Permalink
Fixing bug introduced in r5219 that was preventing model save operati…
Browse files Browse the repository at this point in the history
…ons from working in Console shell

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8222 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information
mariano.iglesias committed Jul 6, 2009
1 parent 72546f3 commit bc5de16
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cake/console/libs/console.php
Expand Up @@ -252,8 +252,7 @@ function main($command = null) {
if ($this->__isValidModel($modelToSave)) {
// Extract the array of data we are trying to build
list($foo, $data) = explode("->save", $command);
$badChars = array("(", ")");
$data = str_replace($badChars, "", $data);
$data = preg_replace('/^\(*(array)?\(*(.+?)\)*$/i', '\\2', $data);
$saveCommand = "\$this->{$modelToSave}->save(array('{$modelToSave}' => array({$data})));";
@eval($saveCommand);
$this->out('Saved record for ' . $modelToSave);
Expand Down Expand Up @@ -336,4 +335,4 @@ function __loadRoutes() {
return true;
}
}
?>
?>

0 comments on commit bc5de16

Please sign in to comment.