mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Prevent undefined index notices
This commit is contained in:
parent
cbd3aa0949
commit
1ec56a1202
@ -213,12 +213,12 @@ abstract class ModelAdmin extends LeftAndMain {
|
||||
|
||||
if(is_array($params)) {
|
||||
$params = ArrayLib::array_map_recursive('trim', $params);
|
||||
}
|
||||
|
||||
// Parse all DateFields to handle user input non ISO 8601 dates
|
||||
foreach($context->getFields() as $field) {
|
||||
if($field instanceof DatetimeField) {
|
||||
$params[$field->getName()] = date('Y-m-d', strtotime($params[$field->getName()]));
|
||||
// Parse all DateFields to handle user input non ISO 8601 dates
|
||||
foreach($context->getFields() as $field) {
|
||||
if($field instanceof DatetimeField && !empty($params[$field->getName()])) {
|
||||
$params[$field->getName()] = date('Y-m-d', strtotime($params[$field->getName()]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user