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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | pdf_preview_image_getthirdpartysettings-3441864-1.patch | 977 bytes | jastraat |
Issue fork pdf_preview_image-3441864
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
Comment #2
jastraat commentedComment #5
abhishek_gupta1 commented@jastraat, applied above patch and issue has fixed, also created MR , moving RTBC++
Comment #7
cameron prince commentedComment #8
cameron prince commented