mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fixing issue where FormHelper::dateTime was generating non valid XHTML
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6745 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
c585658c27
commit
893c218be6
1 changed files with 14 additions and 12 deletions
|
@ -382,15 +382,15 @@ class FormHelper extends AppHelper {
|
|||
$options = array_merge(array('wrap' => true, 'class' => 'error-message', 'escape' => true), $options);
|
||||
|
||||
if ($error = $this->tagIsInvalid()) {
|
||||
if (is_array($error)) {
|
||||
list(,,$field) = explode('.', $field);
|
||||
if (isset($error[$field])) {
|
||||
$error = $error[$field];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
if (is_array($error)) {
|
||||
list(,,$field) = explode('.', $field);
|
||||
if (isset($error[$field])) {
|
||||
$error = $error[$field];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (is_array($text) && is_numeric($error) && $error > 0) {
|
||||
$error--;
|
||||
}
|
||||
|
@ -1356,16 +1356,17 @@ class FormHelper extends AppHelper {
|
|||
}
|
||||
}
|
||||
$elements = array('Day','Month','Year','Hour','Minute','Meridian');
|
||||
$attributes = array_merge(array('minYear' => null, 'maxYear' => null, 'separator' => '-'), (array)$attributes);
|
||||
$defaults = array('minYear' => null, 'maxYear' => null, 'separator' => '-', 'interval' => 1);
|
||||
$attributes = array_merge($defaults, (array) $attributes);
|
||||
if (isset($attributes['minuteInterval'])) {
|
||||
$attributes['interval'] = $attributes['minuteInterval'];
|
||||
} else {
|
||||
$selectMinuteAttr['interval'] = 1;
|
||||
unset($attributes['minuteInterval']);
|
||||
}
|
||||
$minYear = $attributes['minYear'];
|
||||
$maxYear = $attributes['maxYear'];
|
||||
$separator = $attributes['separator'];
|
||||
unset($attributes['minYear'], $attributes['maxYear'], $attributes['separator']);
|
||||
$interval = $attributes['interval'];
|
||||
$attributes = array_diff_key($attributes, $defaults);
|
||||
|
||||
if (isset($attributes['id'])) {
|
||||
if (is_string($attributes['id'])) {
|
||||
|
@ -1416,6 +1417,7 @@ class FormHelper extends AppHelper {
|
|||
$this->minute($fieldName, $min, $selectMinuteAttr, $showEmpty);
|
||||
break;
|
||||
case '12':
|
||||
$selectMinuteAttr['interval'] = $interval;
|
||||
$opt .= $this->hour($fieldName, false, $hour, $selectHourAttr, $showEmpty) . ':' .
|
||||
$this->minute($fieldName, $min, $selectMinuteAttr, $showEmpty) . ' ' .
|
||||
$this->meridian($fieldName, $meridian, $selectMeridianAttr, $showEmpty);
|
||||
|
|
Loading…
Reference in a new issue