Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Admin/BaseFieldDescription.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ public function setOption($name, $value)
* Define the options value, if the options array contains the reserved keywords
* - type
* - template
* - help
*
* Then the value are copied across to the related property value
*
Expand All @@ -210,6 +211,12 @@ public function setOptions(array $options)
unset($options['template']);
}

// set help if provided
if (isset($options['help'])) {
$this->setHelp($options['help']);
unset($options['help']);
}

$this->options = $options;
}

Expand Down Expand Up @@ -475,4 +482,4 @@ public function getLabel()
{
return $this->getOption('label');
}
}
}
3 changes: 2 additions & 1 deletion Tests/Admin/BaseFieldDescriptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ public function testOptions()
$this->assertEquals('trucmuche', $description->getLabel());

$this->assertNull($description->getTemplate());
$description->setOptions(array('type' => 'integer', 'template' => 'foo.twig.html'));
$description->setOptions(array('type' => 'integer', 'template' => 'foo.twig.html', 'help' => 'fooHelp'));

$this->assertEquals('integer', $description->getType());
$this->assertEquals('foo.twig.html', $description->getTemplate());
$this->assertEquals('fooHelp', $description->getHelp());

$this->assertCount(0, $description->getOptions());

Expand Down