Multiple entities and Preview link form

Created on 9 July 2025, about 2 months ago

If the option to reference multiple entities is disabled, shouldn't the "Save" and "Save and regenerate preview link" buttons be hidden on the form to generate new preview links?

๐Ÿ› Bug report
Status

Active

Version

2.2

Component

Code

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom Ok4p1 Glasgow

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Ok4p1
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom Ok4p1 Glasgow

    I have added a MR to conditionally hide the save fields.

  • Pipeline finished with Success
    about 2 months ago
    Total: 198s
    #542885
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vinodhini.e chennai

    Hi @ok4p1,

    Hi,

    Thanks for the patch! I tested this on a local Drupal 11 site with Preview Link v2.2.0-alpha2, but unfortunately, itโ€™s not working as expected.

    Steps to replicate:
    Added an Entity Reference field to a content type.

    Set "Number of values" to 1 (single entity reference).

    Applied the patch from this MR and cleared cache.

    Edited a node of that content type.

    Expected: "Save" and "Save and regenerate preview link" buttons should be hidden.
    Actual: Both buttons are still visible.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom Ok4p1 Glasgow

    Hello vinodhini.e, that's not the way to get this ticket tested.

    The module has a setting to let preview links reference multiple entities under "/admin/config/content/preview_link", that is what you need to enable / disable.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vinodhini.e chennai

    Hello @ok4p1,
    Thank you for the explanation.
    I have tested this scenario, and it is working as expected.
    Marking the issue as RTBC. Thanks.

Production build 0.71.5 2024