From 43ae7af17d8e4b7ab3fde850f4828dfc6a156770 Mon Sep 17 00:00:00 2001 From: AD7six Date: Sun, 20 Nov 2011 15:44:44 +0100 Subject: [PATCH] prevent missing-index notices when baking with a schemaless db --- lib/Cake/Console/Command/Task/ModelTask.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Console/Command/Task/ModelTask.php b/lib/Cake/Console/Command/Task/ModelTask.php index 2ebcdd4c7..ff559ecdf 100644 --- a/lib/Cake/Console/Command/Task/ModelTask.php +++ b/lib/Cake/Console/Command/Task/ModelTask.php @@ -675,7 +675,11 @@ class ModelTask extends BakeTask { $otherTable = Inflector::tableize($className); if (in_array($otherTable, $this->_tables)) { if ($assocType < 3) { - $showKeys = $possibleKeys[$otherTable]; + if (!empty($possibleKeys[$otherTable])) { + $showKeys = $possibleKeys[$otherTable]; + } else { + $showKeys = null; + } } else { $showKeys = null; }