The error occurred after upgrading from Drupal 9 to Drupal 10. To investigate, I exported the configuration files and searched for occurrences of 'content:' strings.
For example, could the following configuration in views.view.comments_recent.yml be causing the error?
label: 'Recent comments'
description: 'Recent comments.'
display:
default:
display_title: Default
display_options:
title: 'Recent comments'
fields:
changed:
settings:
future_format: '@interval hence'
past_format: '@interval ago'
empty:
area_text_custom:
content: 'No comments available.' # Could this be the source of the problem?
block_1:
display_title: Block
display_options:
block_description: 'Recent comments'
block_category: 'Lists (Views)'
Iβm not entirely sure, but could the content: 'No comments available.' string format be causing the issue? Should it now be structured as:
content:
value: 'No comments available.'
format: 'plain_text'
Is this new format required in Drupal 10, and if so, was this change documented? Iβd appreciate any clarification or guidance regarding this.
I encountered the same error and implemented a temporary fix, which needs review. The issue arises because $this->options['content'] is expected to be an array but can sometimes be a string.
Hereβs the patch I applied to web/core/modules/views/src/Plugin/views/area/Text.php:
/**
* {@inheritdoc}
*/
public function preQuery() {
// Normalize $this->options['content'] to ensure it's an array.
if (is_string($this->options['content'])) {
// If it's a string, treat it as the content value with a default format.
$this->options['content'] = [
'value' => $this->options['content'],
'format' => filter_default_format(),
];
}
// Proceed as normal with the now-normalized content array.
$content = $this->options['content']['value'];
// Check for tokens that require a total row count.
if (str_contains($content, '[view:page-count]') || str_contains($content, '[view:total-rows]')) {
$this->view->get_total_rows = TRUE;
}
}
Lance Lancelot β created an issue.
Create a menu with submenu items.
Create a menu_block.
- Initial visibility level: 2
- Number of levels to display: unlimited
Place menu_block in sidebar_first.
On pages where there are no submenu items available (i.e. homepage) sidebar_first is shown.
The problem exists in 9.5.9.
Patches that did not work:
-
https://www.drupal.org/project/menu_block/issues/3271218
π
Menu block renders when tree is empty as of 8.x-1.8 [regression]
Needs review
(both patches)
- https://raw.githubusercontent.com/stef-van-looveren/drupal-8-patches/mas...
The patch from #11 solves the problem for me.
Hi,
I'm running Mime Mail on PHP 8.1 and we have the same problem.
I have a similar site running on PHP 7.4. There are no problems.
I will try the patch and let you know if that solves the problem.
I'am having the same issue.
Just installed the jsmin for homebrew to test localhost.
Some files are not minified due to an error.
Has it something todo with PHP 8.0? I don't know.