Thanks to @kaszarobert for breathing new life into this module!
Problem/Motivation
After upgrading 3.0.0-beta2 => 4.0.1, I couldn't get any output at all from the Facebook embed formatter. I am using oEmbed API. The field template was outputting wrapper mark-up, but it was empty.
I did manage to track down the issue; see below. I will add a patch shortly.
Steps to reproduce
NA
Proposed resolution
Fix typo in theme name in getOembedData(): entity_media_facebook should be media_entity_facebook.
The above fix meant I could get output, but the HTML tags were escaped. I fixed this by outputting {{ url|raw }} in the template.
Remaining tasks
NA
User interface changes
NA
API changes
NA
Data model changes
NA
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3386804-no-formatter-output.patch | 1017 bytes | othermachines |
Comments
Comment #2
othermachines commentedHere's a patch.
Comment #4
kaszarobertI committed your patch. If you really have access to the oEmbed API, then could you please help me out testing another functionality that is connected to this module: #3385553: Check if it still works when rendering post with Facebook Oembed API All we need is to know is what exactly is returned from the oEmbed API and rendered with the field. If you could open a webpage with a Facebook media and right click See source (CTRL + U) and paste the field's HTML to that issue, so we'd be really thankful if you could help us out there.
Neither me or my collegues could get the permission from Facebook to use oEmbed API. I just don't understand why they are rejecting us and not enabling these for development.
Comment #5
othermachines commentedThanks for the commit!
I'll certainly test if I can. Our set-up is a bit unusual in that the embeds generated by this module are rendered only for admins/authorized users (it is a decoupled site). I'll try to have a look in the next week or so.
I did a lot of research (mostly reading about others' experiences) and took copious notes before and during the application submission process, which was approved within minutes, so if you're still aiming for app approval I may be able to help.
Comment #6
kaszarobertI understand. I tried to apply twice with an existing news site as they use Facebook embeds from politicians and social groups for referencing source material. We went through business verification but they declined both of our requests for oembed with no clear explanation after weeks. That was just ridiculous that even for development they did not provide any info and there waas no way testing that even in sandbox mode or something like that.
All we need to see is what response or raw HTML comes through the oEmbed API exactly when it is working (does it include a script tag with SDK, iframe etc.). After that we can mock the oembed service, write tests for it etc.