"You must pass at least entity" exception when users with no permission click "download pdf"

Created on 3 May 2018, about 7 years ago
Updated 2 July 2025, 10 days ago

If a user that does not have permission to print an entity, but have access to the content overview page "admin/content" they can still see the download pdf. When they click on it an error is thrown saying: "You must pass at least entity".

to reproduce:
- enable entity_print
- make sure a user does not have permission "Access Printable version of View"
- go to admin/content page
- select a piece of content
- click on download as PDF.

Expected result : " deny access"

Actual result: exception: "You must pass at least entity".

Possible cause
When access is denied $enteties are being passed as an empty array to renderer.

Proposed Solution
Check $entities array is not empty before sending the array to the renderer, patch attached.

🐛 Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

🇺🇸United States awm

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024