Problem/Motivation

Regression since 5.1.0 (5.0.x is not affected): flag links lose the view mode that #3049155: Disclose flagging view mode in flag theming passes to them, for the flag URLs and the view mode theme suggestions. Two changes cause it:

Steps to reproduce

  1. Create a node flag with the "Confirm Form" link type, form behavior "Modal dialog" and "Display link as field".
  2. Promote a node and visit /node: the flag link URL contains view_mode=default, not teaser.
  3. Click the link and confirm: the re-rendered link contains view_mode=full.

Proposed resolution

  • Pass the view mode to the lazy builder again, and to the link of new entities (preview).
  • In the confirm forms' AJAX submit handler, read the view mode from the request query, falling back to "full".

Sites that added a flag--default.html.twig template since 5.1.0 to target links displayed as a field must rename it to the actual view mode.

Remaining tasks

Review.

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork flag-3626500

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

herved created an issue. See original summary.

herved’s picture

Assigned: herved » Unassigned
Status: Active » Needs review