From b72ab690d49208d86a2bff9d7aa31ff1ec9ccbbb Mon Sep 17 00:00:00 2001 From: gwoo Date: Mon, 4 Dec 2006 18:00:36 +0000 Subject: [PATCH] fix for FormHelper::select() showEmpty git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4067 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/view/helpers/form.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index f7f4d3f4d..92a819a9c 100644 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -471,11 +471,9 @@ class FormHelper extends AppHelper { if($showEmpty === true) { $showEmpty = ''; } - if (isset($options['']) && is_array($options[''])) { - $options = am($options, $options['']); - unset($options['']); - } - $options = am(array('' => $showEmpty), $options); + $options = array_reverse($options, true); + $options[''] = $showEmpty; + $options = array_reverse($options, true); } $select = am($select, $this->__selectOptions(array_reverse($options, true), $selected, array(), $showParents)); $select[] = sprintf($this->Html->tags['selectend']);