Skip to content

Commit

Permalink
Fixed #92 error if the config could not be loaded (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
qzminski authored and ausi committed May 11, 2018
1 parent b0aa71a commit b674d36
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/CustomElements.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,12 @@ protected function prepareSaveData($fieldPrefix, $fieldsConfig)
*/
protected function createDca($dc, $type, $createFromPost = false, $tmpField = null)
{
$config = static::getConfigByType($type);

if (!$config) {
return;
}

$assetsDir = 'bundles/rocksolidcustomelements';

if (TL_MODE === 'BE') {
Expand All @@ -452,8 +458,6 @@ protected function createDca($dc, $type, $createFromPost = false, $tmpField = nu
}

$paletteFields = array();

$config = static::getConfigByType($type);
$standardFields = is_array($config['standardFields']) ? $config['standardFields'] : array();
$this->fieldsConfig = $config['fields'];

Expand Down Expand Up @@ -858,8 +862,12 @@ protected function createDcaMultiEdit($dc)
foreach ($types as $type) {

$paletteFields = array();

$config = static::getConfigByType($type);

if (!$config) {
continue;
}

$standardFields = is_array($config['standardFields']) ? $config['standardFields'] : array();

foreach ($config['fields'] as $fieldName => $fieldConfig) {
Expand Down

0 comments on commit b674d36

Please sign in to comment.