mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Fixed issue where $selected = true sent to FormHelper date method was generating multiple OPTION tags with SELECTED attribute
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6746 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
893c218be6
commit
e0a9f03572
1 changed files with 6 additions and 6 deletions
|
@ -1107,7 +1107,7 @@ class FormHelper extends AppHelper {
|
|||
* @return string
|
||||
*/
|
||||
function day($fieldName, $selected = null, $attributes = array(), $showEmpty = true) {
|
||||
if (empty($selected) && $value = $this->value($fieldName)) {
|
||||
if ((empty($selected) || $selected === true) && $value = $this->value($fieldName)) {
|
||||
if (is_array($value)) {
|
||||
extract($value);
|
||||
$selected = $day;
|
||||
|
@ -1141,7 +1141,7 @@ class FormHelper extends AppHelper {
|
|||
* @return string
|
||||
*/
|
||||
function year($fieldName, $minYear = null, $maxYear = null, $selected = null, $attributes = array(), $showEmpty = true) {
|
||||
if (empty($selected) && $value = $this->value($fieldName)) {
|
||||
if ((empty($selected) || $selected === true) && $value = $this->value($fieldName)) {
|
||||
if (is_array($value)) {
|
||||
extract($value);
|
||||
$selected = $year;
|
||||
|
@ -1176,7 +1176,7 @@ class FormHelper extends AppHelper {
|
|||
* @return string
|
||||
*/
|
||||
function month($fieldName, $selected = null, $attributes = array(), $showEmpty = true) {
|
||||
if (empty($selected) && $value = $this->value($fieldName)) {
|
||||
if ((empty($selected) || $selected === true) && $value = $this->value($fieldName)) {
|
||||
if (is_array($value)) {
|
||||
extract($value);
|
||||
$selected = $month;
|
||||
|
@ -1209,7 +1209,7 @@ class FormHelper extends AppHelper {
|
|||
* @return string
|
||||
*/
|
||||
function hour($fieldName, $format24Hours = false, $selected = null, $attributes = array(), $showEmpty = true) {
|
||||
if (empty($selected) && $value = $this->value($fieldName)) {
|
||||
if ((empty($selected) || $selected === true) && $value = $this->value($fieldName)) {
|
||||
if (is_array($value)) {
|
||||
extract($value);
|
||||
$selected = $hour;
|
||||
|
@ -1243,7 +1243,7 @@ class FormHelper extends AppHelper {
|
|||
* @return string
|
||||
*/
|
||||
function minute($fieldName, $selected = null, $attributes = array(), $showEmpty = true) {
|
||||
if (empty($selected) && $value = $this->value($fieldName)) {
|
||||
if ((empty($selected) || $selected === true) && $value = $this->value($fieldName)) {
|
||||
if (is_array($value)) {
|
||||
extract($value);
|
||||
$selected = $min;
|
||||
|
@ -1279,7 +1279,7 @@ class FormHelper extends AppHelper {
|
|||
* @return string
|
||||
*/
|
||||
function meridian($fieldName, $selected = null, $attributes = array(), $showEmpty = true) {
|
||||
if (empty($selected) && $value = $this->value($fieldName)) {
|
||||
if ((empty($selected) || $selected === true) && $value = $this->value($fieldName)) {
|
||||
if (is_array($value)) {
|
||||
extract($value);
|
||||
$selected = $meridian;
|
||||
|
|
Loading…
Add table
Reference in a new issue