mirror of
https://github.com/processwire/processwire.git
synced 2025-08-15 19:24:28 +02:00
Fix issue processwire/processwire-issues#991
This commit is contained in:
@@ -121,6 +121,9 @@ class FieldtypeToggle extends Fieldtype {
|
||||
*
|
||||
*/
|
||||
public function getDefaultValue(Page $page, Field $field) {
|
||||
if($page->template && !($field->flags & Field::flagFieldgroupContext)) {
|
||||
$field = $page->template->fieldgroup->getFieldContext($field->id);
|
||||
}
|
||||
switch($field->get('defaultOption')) {
|
||||
case 'no': $value = self::valueNo; break;
|
||||
case 'yes': $value = self::valueYes; break;
|
||||
|
Reference in New Issue
Block a user