backdrop-contrib / mini_layouts

Provide blocks which allow positioning content within them in layouts.
GNU General Public License v2.0
7 stars 4 forks source link

PHP 7.4 Errors on save #7

Closed philsward closed 3 years ago

philsward commented 3 years ago

When saving a mini-layout using PHP 7.4, the following errors are presented:

Notice: Undefined property: MiniLayout::$contexts in MiniLayout->save() (line 58 of /home/user/public_html/t/backdrop1.modules/mini_layouts/layout.mini_layouts.class.inc).
Warning: Invalid argument supplied for foreach() in MiniLayout->save() (line 58 of /home/user/public_html/t/backdrop1.modules/mini_layouts/layout.mini_layouts.class.inc).
Notice: Undefined property: MiniLayout::$path in MiniLayout->save() (line 71 of /home/user/public_html/t/backdrop1.modules/mini_layouts/layout.mini_layouts.class.inc).
Notice: Undefined property: MiniLayout::$contexts in MiniLayout->save() (line 84 of /home/user/public_html/t/backdrop1.modules/mini_layouts/layout.mini_layouts.class.inc).
Notice: Undefined property: MiniLayout::$contexts in MiniLayout->save() (line 102 of /home/user/public_html/t/backdrop1.modules/mini_layouts/layout.mini_layouts.class.inc).
Warning: Invalid argument supplied for foreach() in MiniLayout->save() (line 102 of /home/user/public_html/t/backdrop1.modules/mini_layouts/layout.mini_layouts.class.inc).
Warning: Invalid argument supplied for foreach() in Layout->__construct() (line 246 of /home/user/public_html/t/backdrop1.core/modules/layout/includes/layout.class.inc).

Switching back to PHP 7.3 removes the errors.

Specifically saving a mini-layout at a path such as:

https://site.com/admin/structure/mini-layouts/manage/layout_name/configure-layout-blocks
philsward commented 3 years ago

I'm not sure if it's related to these errors or not, but it isn't possible to "remove" a block from a mini-layout in PHP 7.4 either.

7.3 seems to work as expected.

I would recommend fixing the errors first, then testing the removal of a block to see if it's related or a separate issue.

docwilmot commented 3 years ago

Fixed.

philsward commented 3 years ago

Awesome, thx. I'll take another look.

philsward commented 3 years ago

Tested and looks good.