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

Fatal error when running mini_layouts_update_1000() #46

Closed indigoxela closed 4 months ago

indigoxela commented 4 months ago

What I get:

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: .../update.php?op=selection&token=Iad48S...&id=915&op=do_nojs&op=do StatusText: Service unavailable (with message) ResponseText: TypeError: Illegal offset type in isset or empty in backdrop_html_class() (line 4334 of .../core/includes/common.inc).

And the update fails with message:

The update process was aborted prematurely while running update #1000 in mini_layouts.module. All errors have been logged. You may need to check the watchdog database table manually.

The problematic line in the update:

$config->set('rows.' . $row_key . '.region_names.region_' . $number . '.name', backdrop_html_class($region_name));

The problem is, that backdrop_html_class() expects a string, but region name at that point (on my site) is an array.

Debug:

array (
  'label' => 'Top',
  'name' => 'top',
)

Changing it to backdrop_html_class($region_name['name']) fixed it for me. Not sure, if this $region_name is always an array, though, or just some special case (old stuff) on my site (no production site, btw, so no big problem for me, but might be for others).

performd commented 4 months ago

Same error here running multi-site. Some sites were ported from Drupal but others were built on Backdrop. Same error on all sites.

indigoxela commented 4 months ago

Hm. So, it's not just my site. Pinging @docwilmot to get some maintainer attention.

indigoxela commented 4 months ago

I'm not very familiar with mini_layouts. In fact, that is was still installed on my site was an oversight.

Looking at the commit that added that update hook, it seems that previously this "region name" used to be a string, but is now an array. So, if it's an array already, there's nothing to update, anyway. Caution: lots of assumptions on my side. :wink:

My PR just skips over that region, then.

performd commented 4 months ago

Thanks indigoxela, works for all my sites.

yorkshire-pudding commented 4 months ago

Works for me. @docwilmot - this probably needs releasing so other people don't encounter when updating