The recent core update to core 11.4.0 RE View modes' displays results in WSD when attempting to adjust a view mode that uses the Manage Display module to include and modify the presentation of the Title 'field'.

The core update breaks down "Link to Content" into: "Link to view content" and "Link to edit content"

The with problem Manage Display is that the configuration form code does not save the state of the two checkboxes and the net result is that the content is no longer linked...

mange_display_module_fails_to_save_core_settings

I have marked this a critical because the other net effect is that it results in WSD when attempting to edit a view mode that already employs the Manage Display module to include (say) node Title and the site-builder cannot get back in through the UI to fix it- uh oh!

The WSD can be mitigated by editing line 125 of \core\lib\Drupal\Core\Field\Plugin\Field\FieldFormatter\StringFormatter.php

to read…

$link_rel = $this->getSetting('link_rel') ?? 'canonical';

instead of…

$link_rel = $this->getSetting('link_rel');

Perhaps the maintainers of this module could/should raise a core ticket on that as I'm sure many people will find their site-building knocked out by this and other modules that don't set the $link_rel value?

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sirclickalot created an issue. See original summary.

sirclickalot’s picture

Issue summary: View changes
gurkawal’s picture

StatusFileSize
new1 KB

Hi @sirclickalot I was able to reproduce the issue with drupal 11.4

I agree with your point that Drupal core could also handle this more safely. If `link_rel` is missing, adding a fallback in `StringFormatter.php` would help prevent a WSD. So yes, this may be worth opening as a separate core issue, because other contrib/custom formatters could run into the same problem after Drupal 11.4.

At the same time, I think Manage Display also needs a small fix here. The Title formatter in Manage Display extends core’s `StringFormatter`, but its `defaultSettings()` was not including the parent formatter defaults. Because of that, the new Drupal 11.4 setting `link_rel` was not saved properly in the Manage Display formatter configuration.

I have added a patch for the Manage Display side that:
- Adds `link_rel` to the config schema for the title formatter.
- Updates `TitleFormatter::defaultSettings()` to include `parent::defaultSettings()`, so new core formatter settings like `link_rel` are picked up automatically.

You can review this once

A separate core issue for adding a safe fallback in `StringFormatter.php` would still be useful, but this patch should fix the Manage Display-specific problem where the selected link destination is not saved.

sirclickalot’s picture

Thanks @gurkawal

I can confirm that, even with the Drupal 11.4.0 quick fix that I suggested REMOVED, the patch from #3 restores full functionality.

Nick work, no more mis-rendered node titles and no more WSD.

fonant’s picture

Thank you @gurkawal

I can also confirm that the patch #3 fixes the WSOD when using "Manage Display" title field settings with Drupal 11.4.

rosk0’s picture

Status: Active » Reviewed & tested by the community

Thanks for the patch!

Tested on Drupal 11.4.2, PHP 8.3 - works as a charm!

dalemoore’s picture

The patch is also working for me as well, was very confused when I upgraded my local dev site to 11.4 and all manage display screens WSOD.

sharonho’s picture

on 11.4.4 and this patch works perfectly! thank you!

guilhom’s picture

Confirming this affects more than the WSOD when editing the view mode.

In our case, the title formatter was used directly on a Manage Display view mode (entity_view_display) for a content type, not just referenced from a Views field.

Under Drupal 11.4, this silently breaks the link output: TitleFormatter::defaultSettings() never sets link_rel, so getSetting('link_rel') returns NULL, and EntityType::hasLinkTemplate(NULL) evaluates to false. The result is that render_as_link in core's StringFormatter::viewElements() is always false. The title still renders (via the formatter's own #prefix/#suffix tag wrapping), but the <a> link around it silently disappears. No error, no WSOD, just a quiet loss of every entity link wherever this formatter is used with "Link to entity" enabled.

This is arguably worse than the WSOD case since it fails silently and can easily go unnoticed in production (title text still displays normally, just without a link).

Applied the patch from comment #3 and confirmed it fixes this case too. link_rel now resolves to canonical by default and links are restored.

begamen’s picture

Confirming the patch works, before the patch it also broke some views etc. I think critical priority is correct, because of the WSOD.

Thank you for the patch

pameeela’s picture

peacog made their first commit to this issue’s fork.

peacog’s picture

Thanks for the patch. I've created an MR for it.

It's not necessary to update manage_display.schema.yml because this module inherits the core field.formatter.settings.string schema. So the MR just includes the change to TitleFormatter::defaultSettings()

adamps’s picture

Thanks this looks good. We need to fix the broken tests in #3614986: Fix automated tests before we can merge this.

adamps’s picture

Title: Drupal 11.4.0 update results in errors » Error from Drupal 11.4.0 extra setting on StringFormatter

Now rebasing, hopefully should get green tests

  • adamps committed e7689f68 on 3.x authored by peacog
    fix: #3607918 Error from Drupal 11.4.0 extra setting on StringFormatter...
adamps’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.