Skip to content

Commit

Permalink
Added support for default values, closes #17
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed Aug 1, 2014
1 parent ed820b7 commit fca57d2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/MadeYourDay/Contao/CustomElements.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ public function loadCallback($value, $dc)
{
$value = $this->getNestedValue($dc->field);

if ($value === null && isset($GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['default'])) {
$value = $GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['default'];
}

if (
version_compare(VERSION, '3.2', '>=') &&
$GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['inputType'] === 'fileTree' &&
Expand Down

0 comments on commit fca57d2

Please sign in to comment.