As noted in the D8 version issue, but not yet fixed in the code.
My fix was:
Add:
use Drupal\Core\Config\Entity\ThirdPartySettingsInterface;
Change:
if ($field->getThirdPartySetting('simple_image_rotate', 'enable_rotate') == 1) {
to
if (($field instanceof ThirdPartySettingsInterface) && $field->getThirdPartySetting('simple_image_rotate', 'enable_rotate') == 1) {
Comments
Comment #2
nigelcunningham commentedI have confirmed the issue and the fix with the Background images module. I'm attaching a variant of fonant's proposed fix as a patch.
Comment #3
jascote commentedThe patch from @NigelCunningham fixed a similar issue in a different function, not the one referenced by the original issue. Here's a patch that fixes the issue with the getThirdPartySetting() method in both places.
Comment #4
afagioliOn a working D8 website with SIR up and runnign, I enable Media entity module for a new content type with a Audio field.
Saving that content type, I have the same issue we're discussing here.
I'm thus a bit suprised I got inside
when saving a content type with no image involved...
To be noted that
if (($field instanceof ThirdPartySettingsInterface) && $field->getThirdPartySetting('simple_image_rotate', 'enable_rotate') == 1) {fixed my issue
Comment #5
afagioliHow can we push this forward?
How can we have this fix in next "composer update?" :)
Comment #6
khoomy commentedComment #7
afagioliThanks Khoomy. Patch #3 applied
Comment #8
afagioli