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.

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

jastraat created an issue. See original summary.

jastraat’s picture

Status: Active » Needs review
StatusFileSize
new977 bytes

abhishek_gupta1 made their first commit to this issue’s fork.

abhishek_gupta1’s picture

Status: Needs review » Reviewed & tested by the community

@jastraat, applied above patch and issue has fixed, also created MR , moving RTBC++

cameron prince made their first commit to this issue’s fork.

cameron prince’s picture

Status: Reviewed & tested by the community » Fixed
cameron prince’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.