Solutions-Nitriques / oembed_field

Easily embed videos/images from ANY website that implements the oEmbed format
http://symphonyextensions.com/Solutions-Nitriques/oembed_field/
Other
7 stars 11 forks source link

Error while loading the xml into the document (Twitter user timeline) #56

Closed finferflu closed 8 years ago

finferflu commented 8 years ago

Hello,

This extension was working just fine when I installed it, however, today when I visited the entry page, the feed wasn't displayed, and I saw the following error in the Symphony log:

Warning: GenericErrorHandler 2: DOMDocument::loadXML(): Start tag expected, '<' not found in Entity, line: 1 on line 165 of file /path/to/symphony/extensions/oembed_field/lib/class.serviceDriver.php

The oEmbed URL in question is https://twitter.com/finferflu or any Twitter timeline really.

Is there anything that could have caused that issue to appear all of a sudden?

Thanks!

nitriques commented 8 years ago

Which version of oembed field are you running ? Twitter stopped returning xml responses a couple of time ago and we've made the switch to 'json' so it should work...

finferflu commented 8 years ago

Thanks a lot for getting back to me. I'm using the latest version available on symphonyextensions.com (1.9.0). As I mentioned, this was working just fine up until 2-3 weeks ago. Has anything changed in the last couple of weeks?

nitriques commented 8 years ago

when I visited the entry page

In the backend you mean ?

this was working just fine up until 2-3 weeks ago. Has anything changed in the last couple of weeks?

Not that I am aware of...

nitriques commented 8 years ago

I am sadly not able to reproduce. Can you give me a complete url of a tweet that won't work ?

finferflu commented 8 years ago

Yes, that error shows up in the log when I visit the entry page in the backend. On the front end, in debug mode, I can see the following:

    <twitter-feed-data>
        <section id="9" handle="twitter-feed">Twitter Feed</section>
        <entry id="88">
            <feed-url id="https://twitter.com/finferflu">
                <title handle=""></title>
                <url>https://twitter.com/finferflu</url>
                <thumbnail></thumbnail>
                <driver>Twitter</driver>
                <protocols>
                    <item>https</item>
                    <item>http</item>
                </protocols>
                <error>Error while loading the xml into the document</error>
            </feed-url>
        </entry>
    </twitter-feed-data>

I am trying to embed a whole timeline, so the URL I'm using is this one, for example: https://twitter.com/finferflu

Here is a screenshot of what the back-end looks like:

screenshot 2016-10-13 00 48 23
finferflu commented 8 years ago

For the record, I did try to delete and reinstall the extension, but it didn't make a difference.

nitriques commented 8 years ago

I've never actually tried to embed complete timelines! But I just did and it works...

Can you go into the database to check what's the saved xml ?

nitriques commented 8 years ago

screen shot 2016-10-12 at 8 03 41 pm

finferflu commented 8 years ago

Sure, can you please point me to where in the database I should check exactly? Thanks!

Also, the screenshot you attached is exactly how I would see that area in the back-end. I don't understand why it has stopped working all of a sudden.

nitriques commented 8 years ago

I know why you are seeing an error in the log, and they are ok. But it should work.

You can check in the sym_entries_data_X (where X is your field's id). In the column oembed_xml. You should oddly find some json data in there...

nitriques commented 8 years ago

Do you have any errors in the console ?

finferflu commented 8 years ago

Thanks, found it!

The column url_oembed_xml contains:

https://publish.twitter.com/oembed?url=https%3A%2F%2Ftwitter.com%2Ffinferflu

The column oembed_xml contains:

{"url":"https:\/\/twitter.com\/finferflu","title":"","html":"\u003Ca class=\"twitter-timeline\" href=\"https:\/\/twitter.com\/finferflu\"\u003ETweets by finferflu\u003C\/a\u003E\n\u003Cscript async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"\u003E\u003C\/script\u003E","width":null,"height":null,"type":"rich","cache_age":"3153600000","provider_name":"Twitter","provider_url":"https:\/\/twitter.com","version":"1.0"}

nitriques commented 8 years ago

Yeah I have the same thing...

nitriques commented 8 years ago

But I do have

Syntax error, malformed JSON. on 97 of file /home/dev/public_html/sym6/symphony/lib/toolkit/class.json.php in my data source tho..

finferflu commented 8 years ago

Hah! I'm a bit embarrassed about having to report this, but it turns out my browser extension Ghostery was blocking that content. I had AdBlock disabled but forgot about that extension altogether. That error in the log misled me to think it was an issue with the extension and not with the browser. Sorry for wasting your time like that!

finferflu commented 8 years ago

At the same time, though, the feed is still not visible in the front-end. I still get that "Error while loading the xml into the document" message. So there is still an issue somewhere.

nitriques commented 8 years ago

Ok great we are making progress. At least, we both have the same result!

finferflu commented 8 years ago

Yes. In that case, though, I can't remember whether the front-end was working at all in the past because I had just come back to it today in order to work on it for the first time.

nitriques commented 8 years ago

It does not looks like it ever worked, sadly. Or it did but Twitter changed some things in their JSON responses and it broke it. I'll dig deeper to try to fix it ;)

finferflu commented 8 years ago

Well, I'm glad to hear that, thank you very much! :)

nitriques commented 8 years ago

@finferflu wanna test the latest dev branch ? d3166c6 would be enough, but I could not NOT touch other things as well (while debugging) Thanks!

nitriques commented 8 years ago

yeah dev is now 8 commits ahead :P but a 1.10.0 release is ready to be shipped. If you could just test it before I release, that would be cool. Thanks again.

finferflu commented 8 years ago

Sorry, I eventually went to bed. I am going to test this today and will let you know. Thank you very much for the super speedy updates!

finferflu commented 8 years ago

OK, I tried it and it works! Thanks for that!

As a side note, though, I can't seem to get any URL parameters (the ones you set in when creating the section) to actually work. I tried with "width=200" or "maxwidth=200" (as indicated in the Twitter oEmbed documentation), but I see no difference either in how the feed is displayed or in the XML in Symphony debug mode. Is there anything I'm missing?

UPDATE: All the other URL parameters I tried are working ok, it's just an issue with the maxwidth parameter, but I don't really mind about it right now.

nitriques commented 8 years ago

As the doc says:

This value must be between 220 and 550 inclusive.

So if 200 is not working, it's normal ;)

Thanks. I'll release right now.

finferflu commented 8 years ago

Ah you're right, thanks!

nitriques commented 8 years ago

;) 1.10.0 is available right now ;)

finferflu commented 8 years ago

Yes, I've noticed thanks a lot! I kept the dev version installed as I believe there's no difference with the master one, right?

nitriques commented 8 years ago

Nope, no difference.