globalParams -Areablock


PIMCORE v5.4.4
I’m trying to use globalParams in my areablock,

But I get the following ERROR when i add globalParams to my Areabrick:

Warning: Invalid argument supplied for foreach()

Any help please!?
Regards M.Ali


I think I found the issue for this, globalParams expect the value to be an array not a string, exactly as params if we look at the code at


“globalParams” => [
“myGlobalParam” => [“Global param value”]

But the return vill be an array and not a string:
array1:[ 0 => "Global param value" ]


The outputEditmodeOptions should have a one more if else sats:


protected function outputEditmodeOptions(array $options, $return = false)
        // clean up invalid brick editmode options
        if (array_key_exists('options', $options)) {
            foreach (['params', 'globalParams'] as $paramKey) {
                if (array_key_exists($paramKey, $options['options'])) {
                    $validOptions = ['forceEditInView', 'editWidth', 'editHeight'];
                    foreach ($options['options'][$paramKey] as $brickName => $params) {

                        if ($paramKey == 'globalParams') {
                            if (!in_array($brickName, $validOptions)) {
                        } else {
                            foreach ($params as $key => $val) {
                                if (!in_array($key, $validOptions)) {

        parent::outputEditmodeOptions($options, $return);

Now it is working fine for me!


I hope Pimcore kan get it fix with next release !