The "Print link" field no longer exists in Views to add for printing an entity

Created on 23 March 2025, 4 months ago

Problem/Motivation

Drupal 11 - The Entity Print Views module no longer has the field that can be added to a view for printing an entity.

Steps to reproduce

In Drupal 11, install the Entity Print and Entity Print Views modules, create a view displaying entities, and try to add the Print link field. You won't be able to add it because the field no longer exists.

Those who upgrade from Drupal 10 to Drupal 11 and already have this field added to their views will see a "Broken handler" message.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.15

Component

Code

Created by

🇭🇷Croatia milosr Croatia, Montenegro

Live updates comments and jobs are added and updated live.
  • views

    Involves, uses, or integrates with views. In Drupal 8 core, use the “VDC” tag instead.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @milosr
  • 🇮🇳India sorabh.v6 Indore

    Starting to work on the issue.

  • Assigned to sorabh.v6
  • Status changed to Postponed: needs info about 1 month ago
  • 🇊🇺Australia jannakha Brisbane!

    @milosr can you provide more information and screenshots?

    I've had entity print on view to print each node as Custom Text since Drupal 8 (now Drupal 10.5):
    <a href="/print/pdf/node/{{ nid }}" title="download pdf for {{ title_2 }}"><span class="file file--mime-application-pdf file--application-pdf"> </span></a>

    Do you have another module? or custom code?

  • I had the same problem after D11 upgrade, Broken/missing handler.

    Temporary I added the content by id and created a custom text field to print like this format.

  • 🇊🇺Australia jannakha Brisbane!

    @eszszabo thanks for the screenshot, but it doesn't really help with which handler is missing.
    Do you have a screenshot of D10 to compare to?
    what's the name of the handler which is missing? (you can see it in configuration yml of the view)

  • These are the screenshots from D10:


    And these are the related fields with broken handlers from the yml of the view:

    display_options:
    fields:
    entity_print_node:
    id: entity_print_node
    table: node
    field: entity_print_node
    relationship: field_report_reference
    group_type: group
    admin_label: PDF
    entity_type: node
    plugin_id: entity_print_link
    label: ''
    exclude: true
    alter:
    alter_text: false
    text: '

    {{ entity_print_node }}

    '
    make_link: false
    path: ''
    absolute: false
    external: false
    replace_spaces: false
    path_case: none
    trim_whitespace: false
    alt: ''
    rel: ''
    link_class: ''
    prefix: ''
    suffix: ''
    target: ''
    nl2br: false
    max_length: 0
    word_boundary: true
    ellipsis: true
    more_link: false
    more_link_text: ''
    more_link_path: ''
    strip_tags: false
    trim: false
    preserve_tags: ''
    html: false
    element_type: ''
    element_class: ''
    element_label_type: ''
    element_label_class: ''
    element_label_colon: false
    element_wrapper_type: ''
    element_wrapper_class: ''
    element_default_classes: true
    empty: ''
    hide_empty: false
    empty_zero: false
    hide_alter_empty: true
    text: PDF
    export_type: pdf
    open_new_window: false
    entity_print_node_1:
    id: entity_print_node_1
    table: node
    field: entity_print_node
    relationship: field_report_reference
    group_type: group
    admin_label: Word
    entity_type: node
    plugin_id: entity_print_link
    label: ''
    exclude: true
    alter:
    alter_text: false
    text: '

    {{ entity_print_node_1 }}

    '
    make_link: false
    path: ''
    absolute: false
    external: false
    replace_spaces: false
    path_case: none
    trim_whitespace: false
    alt: ''
    rel: ''
    link_class: ''
    prefix: ''
    suffix: ''
    target: ''
    nl2br: false
    max_length: 0
    word_boundary: true
    ellipsis: true
    more_link: false
    more_link_text: ''
    more_link_path: ''
    strip_tags: false
    trim: false
    preserve_tags: ''
    html: false
    element_type: ''
    element_class: ''
    element_label_type: ''
    element_label_class: ''
    element_label_colon: false
    element_wrapper_type: ''
    element_wrapper_class: ''
    element_default_classes: true
    empty: ''
    hide_empty: false
    empty_zero: false
    hide_alter_empty: true
    text: DOC
    export_type: word_docx
    open_new_window: false

  • 🇊🇺Australia jannakha Brisbane!

    thanks for info, moving to active

  • New to contributing have confirm the issue when upgrading from Drupal 10.5 to 11.2.
    The following change in my patch fixes the issue

  • Pipeline finished with Failed
    20 days ago
    Total: 333s
    #546308
  • 🇊🇺Australia larowlan 🇊🇺🏝.au GMT+10

    Great fix @obsidian_ - I think the fact that these are now 'legacy' hooks because they're not OO is why this stopped working

  • 🇊🇺Australia jannakha Brisbane!
  • 🇊🇺Australia jannakha Brisbane!
  • 🇊🇺Australia jannakha Brisbane!

    @obsidian_ thanks for your contribution.

    @eszszabo can you please review merge request #78?

  • Dear @jannakha,

    I could apply the patch and it does not display broken/missing handler anymore but when I try to print it, it says Access denied.

    I tested with admin and allowed it to other user role the Access Printable version of View permission but is it always access denied.

    Is there anything else what I can check or change?

  • 🇊🇺Australia jannakha Brisbane!

    @eszszabo thanks for testing!
    can you provide any related error logs from admin/reports/dblog and php/apache logs?

  • Dear @jannakha,

    in the end it is working fine.
    It was my mistake that I forgot that I altered the custom text field while I made a temporary fix before and was creating the link wrong.
    Now I added back the original custom text with the correct format with the entity print.

    So I confirm that the patch works.

  • 🇊🇺Australia jannakha Brisbane!

    @eszszabo thanks for testing!
    moving to RTBC

  • 🇊🇺Australia jannakha Brisbane!
Production build 0.71.5 2024