- Status changed to Needs review
about 2 months ago 10:20pm 10 February 2025 - 🇨🇦Canada smulvih2 Canada 🍁
I'm seeing the same error using 2.12.0. In my case, I have an image field using Entity browser on the user profile. When I select an image to use, I get the AJAX error reported in ticket description.
The error "Call to undefined method Drupal\media\Entity\Media::getFileUri()" occurs because Media entities do not have a
getFileUri()
method. Instead, we need to get the file entity from the media field.Attached is a patch that fixes the issue for me.
- 🇨🇦Canada smulvih2 Canada 🍁
Ran into an issue with patch #15 where it was calling the wrong method
getSource()
on aFile
entity. New patch accounts for this.