Module incompatible with entities containing file fields without the getThirdPartySettings() function

Created on 18 April 2024, 7 months ago
Updated 19 April 2024, 7 months ago

Problem/Motivation

Entities outside of the standard node and media may have file fields that do not have the getThirdPartySettings() function. In those cases, PDF Preview Images's entity_presave hook prevents the entity from saving with the following error:

Error: Call to undefined method Drupal\Core\Field\BaseFieldDefinition::getThirdPartySetting() in pdf_preview_image_entity_presave()

Steps to reproduce

Install a module like section_library which defines an entity with a file field that does not use that method and attempt to save an entity.

Proposed resolution

Adding a check to make sure that the field definition has the getThirdPartySettings() function before calling it resolves this problem.

๐Ÿ› Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States jastraat

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024