Issue Bug Closed

#83322AbstractNode::mergeChildReturnIntoExistingResult does not check empty fields before using foreach

Wolfgang Klinger 12/14/17, 11:31 updated 10/02/18, 10:53

Description

foreach ($childReturn['additionalJavaScriptPost'] as $value) {
            $existing['additionalJavaScriptPost'][] = $value;
}

… (4 occurrences)

so any custom Node has to return an array with all these elements even if not using them.

    public function render()
    {
        // all these fields are required
        $result = [
            'html' => 'Hello world!',

            'additionalJavaScriptPost' => [],
            'additionalJavaScriptSubmit' => [],
            'additionalHiddenFields' => [],
            'stylesheetFiles' => []
        ];

        return $result;
    }

Reviews 2