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

Blank Context Modal Before First Save With Errors That Follow Save #21

Closed philsward closed 2 years ago

philsward commented 2 years ago

When creating a new mini-layout from scratch and clicking the +Add context link, a blank modal form is presented.

image

Closing the modal box and saving the form results in the errors:

Notice: Trying to access array offset on value of type bool in layout_ajax_form_open_dialog() (line 2728 of ./core/modules/layout/layout.admin.inc).
Notice: Undefined index: title in mini_layouts_admin_configure_validate() (line 432 of ./modules/dev/mini_layouts/mini_layouts.admin.inc).

image

After that first save, the context form works properly as expected.

docwilmot commented 2 years ago

I've had to make context unavailable until the mini layout is first saved. To fix this otherwise would really complicate things.

philsward commented 2 years ago

Sounds good.

I haven't tested it yet, so tongue in cheek.

Is it worth having a placeholder for the context with some text saying "Save the mini-layout first to add contexts."?

docwilmot commented 2 years ago

Is it worth having a placeholder for the context with some text saying "Save the mini-layout first to add contexts."?

That was part of the fix, yes.