The following code is a small hack to alter this behavior, however the bug still stands:
Code:
class tl_bug_palette extends Backend{
function field_save($value,$dca){
$this->import('Database');
$r=$this->Database->prepare('SELECT palette from tl_bug_palette WHERE id=?')
->execute($dca->id);
if($r->palette!=$value){
$GLOBALS['TL_DCA']['tl_bug_palette']['fields']['alpha']['eval']['mandatory']=false;
}
return $value;
}
}
This should be added to the save_callback for the palette selector field that is being used:
Code:
'palette' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_bug_palette']['palette'],
'default' => 'palette1',
'exclude' => true,
'sorting' => true,
'flag' => 11,
'filter' => true,
'inputType' => 'select',
'options' => array('palette1','palette2','palette3'),
'save_callback' => array(
array('tl_bug_palette','field_save')
),
'eval' => array('submitOnChange'=>true, 'tl_class'=>'w100')
)
Bookmarks