问题描述
该错误位于下面的所寻址文件的下面几行(第186和187行):
网站(实时):www.healthyminds.world
尝试还原较早的备份(24小时后),但这也不起作用。
源行中的186和187行:
CharResponseWrapper responseWrapper = new CharResponseWrapper((HttpServletResponse) response);
错误消息(在网站的所有页面上,这些只是其中的几行):
$collections = get_option('google_typography_collections');
$google_fonts_all = $this->get_fonts();
$import_fonts = array();
if ($collections) {
foreach ($collections as $collection) {
$font_family = $collection['font_family'];
$font_index = array_search($font_family,array_column($google_fonts_all,'family'));//Line 186
$font_variants = implode(',',$google_fonts_all[$font_index ['variants']); //Line 187
array_push(
$import_fonts,array(
'font_family' => $collection['font_family'],'font_variant' => $font_variants,
解决方法
您会收到错误消息,因为在第186行中,$ google_fonts_all不包含带有'family'键的数组,或者它不是数组。无论哪种情况,表达式array_column($ google_fonts_all,'family')都返回空。
您可以将后面的表达式提取到变量中: $ family = array_column((array)$ google_fonts_all,'family');
在第187行上,在条件语句或行程中检查isset($ google_fonts_all [$ font_index] ['variants'])。
问候 埃里亚苏
,智慧实验室已发布patch来解决此问题。