Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refactoring ModelTask::_confirmAssociations() so it doesn't fail with…

… $i counter.
  • Loading branch information...
commit 780e85a0315c139ece1526834bfd03e9951acbf0 1 parent 64045e1
@markstory markstory authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 cake/console/libs/tasks/model.php
View
6 cake/console/libs/tasks/model.php
@@ -603,9 +603,9 @@ function confirmAssociations(&$model, $associations) {
if (!empty($associations[$type])) {
$count = count($associations[$type]);
$response = 'y';
- for ($i = 0; $i < $count; $i++) {
- $prompt = "{$model->name} {$type} {$associations[$type][$i]['alias']}";
- $response = $this->in("{$prompt}?", array('y','n'), 'y');
+ foreach ($associations[$type] as $i => $assoc) {
+ $prompt = "{$model->name} {$type} {$assoc['alias']}?";
+ $response = $this->in($prompt, array('y','n'), 'y');
if ('n' == strtolower($response)) {
unset($associations[$type][$i]);
Please sign in to comment.
Something went wrong with that request. Please try again.