DirectorObjectForm: no default object_type

This commit is contained in:
Thomas Gelf 2016-03-07 14:14:52 +01:00
parent 8da2991e76
commit aa53d57ec8
1 changed files with 2 additions and 7 deletions

View File

@ -858,14 +858,13 @@ print_r($object);
protected function addObjectTypeElement()
{
$default = 'object';
$object = $this->object();
if ($this->object()->supportsImports()) {
if ($object->supportsImports()) {
$templates = $this->enumAllowedTemplates();
// TODO: getObjectname is a confusing method name
if (empty($templates) && $this->getObjectname() !== 'Command') {
$default = 'template';
$types = array('template' => $this->translate('Template'));
} else {
$types = array(
@ -883,10 +882,6 @@ print_r($object);
$types['apply'] = $this->translate('Apply rule');
}
if (! $this->hasObject()) {
$this->object()->object_type = $default;
}
$this->addElement('select', 'object_type', array(
'label' => $this->translate('Object type'),
'description' => $this->translate(