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

fonant created an issue. See original summary.

nigelcunningham’s picture

I 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.

jascote’s picture

The 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.

afagioli’s picture

On 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

  foreach ($fields as $field_name => $field) {
    if ($field->getType() == "image") {
    ....
   }

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

afagioli’s picture

How can we push this forward?
How can we have this fix in next "composer update?" :)

khoomy’s picture

Assigned: Unassigned » afagioli
afagioli’s picture

Thanks Khoomy. Patch #3 applied

afagioli’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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