Skip to content

Commit f398d44

Browse files
committed
ensure that custom defaults are not lost
1 parent 1f79119 commit f398d44

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

Admin/RouteAdmin.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,23 @@ public function getExportFormats()
9797

9898
protected function configureFieldsForDefaults()
9999
{
100-
return array(
101-
array('_controller', 'text', array('required' => false)),
102-
array('_template', 'text', array('required' => false)),
103-
array('type', 'cmf_routing_route_type', array(
100+
$defaults = array(
101+
'_controller' => array('_controller', 'text', array('required' => false)),
102+
'_template' => array('_template', 'text', array('required' => false)),
103+
'type' => array('type', 'cmf_routing_route_type', array(
104104
'empty_value' => '',
105105
'required' => false,
106106
)),
107107
);
108+
109+
$dynamicDefaults = $this->getSubject()->getDefaults();
110+
foreach ($dynamicDefaults as $name => $value) {
111+
if (!isset($defaults[$name])) {
112+
$defaults[$name] = array($name, 'text', array('required' => false));
113+
}
114+
}
115+
116+
return $defaults;
108117
}
109118

110119
public function prePersist($object)

0 commit comments

Comments
 (0)