mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: updated select options classes to work with the dataobjectset returned by selectoptions rather than the array previously
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@105872 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
72b93b7502
commit
31a7bbc6a3
@ -1478,12 +1478,13 @@ class TableListField_Item extends ViewableData {
|
|||||||
*/
|
*/
|
||||||
function SelectOptionClasses(){
|
function SelectOptionClasses(){
|
||||||
$tagArray = array('markingcheckbox');
|
$tagArray = array('markingcheckbox');
|
||||||
|
|
||||||
$options = $this->parent->SelectOptions();
|
$options = $this->parent->SelectOptions();
|
||||||
if(!empty($options)){
|
if($options && $options->exists()){
|
||||||
foreach($options as $optionKey => $optionTitle){
|
foreach($options as $option){
|
||||||
if($optionKey !== 'all' && $optionKey !== 'none'){
|
if($option->Key !== 'all' && $option->Key !== 'none'){
|
||||||
if($this->$optionKey) {
|
if($this->{$option->Key}) {
|
||||||
$tagArray[] = $optionKey;
|
$tagArray[] = $option->Key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,6 @@ class TableListFieldTest extends SapphireTest {
|
|||||||
|
|
||||||
$table->addSelectOptions(array("F"=>"FieldF"));
|
$table->addSelectOptions(array("F"=>"FieldF"));
|
||||||
$tableHTML = $table->FieldHolder();
|
$tableHTML = $table->FieldHolder();
|
||||||
|
|
||||||
$p = new CSSContentParser($tableHTML);
|
$p = new CSSContentParser($tableHTML);
|
||||||
$this->assertContains('rel="F"', $tableHTML);
|
$this->assertContains('rel="F"', $tableHTML);
|
||||||
$tbody = $p->getByXpath('//tbody');
|
$tbody = $p->getByXpath('//tbody');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user