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 after upgrading to 2.3.5 #43

Closed mblabs closed 10 years ago

mblabs commented 10 years ago

After upgrade symphony to 2.3.5 the server returns this error: Call to a member function getAPIFormat() on a non-object in extensions/oembed_field/fields/field.oembed.php on line 461

nitriques commented 10 years ago

Which version of the extension ? Which service is active ?

mblabs commented 10 years ago

I've updated from 1.5.1 Only Youtube Service is active

nitriques commented 10 years ago

Looks like the driver can't be found. Can you try:

  1. Re-save the section where the oembed resource is.
  2. Update to the new, 1.8 release am I doing right now.
mblabs commented 10 years ago

Done but Nothing... I believe it happens because sometimes I didn't fill the field... Why the field can't be empty?

nitriques commented 10 years ago

You need to uncheck the 'mark as required' check box in the section settings page.

mblabs commented 10 years ago

The "mark required" is unchecked... in my post I mean that if I didn't fill the field the error happens, but if I fill the field all is ok, the DS returns the node correctly and there are no errors. The extension tries to create the node in the DS even if the field is empty and, for me, this is the cause of the error, but I have no idea where the code needs changes.

nitriques commented 10 years ago

Hum, this never happened to me.

create the node in the DS even if the field is empty

This should not happen. See https://github.com/Solutions-Nitriques/oembed_field/blob/master/fields/field.oembed.php#L437

I do not know how I can help you. Can you give me a screenshot of the error ?

nitriques commented 10 years ago

What do you means by filling the field ? In the publish page ?

Whats your field settings ?

nitriques commented 10 years ago

Hey! We were able to reproduce the bug. Please update the code to the lastest version in the dev branch to see if it resolved your problems.

mblabs commented 10 years ago

Great... we are almost there.. After upgrading The server returns this error:

Fatal error: Call to a member function createXML() on a non-object in /www/extensions/oembed_field/fields/field.oembed.php on line 479

but now... if I comment the row 479 the ds returns partially the node (before was empty)

                <video id="http-wwwyoutubecom-oembed-format=xml-and-url=http-wwwyoutubecom-watch-v=i6h5xwynama">
                    <title handle="maria-di-trapani-2013-reality-arrabbiatissima">MARIA di Trapani 2013   Reality   ((( Arrabbiatissima )))))</title>
                    <url>http://www.youtube.com/watch?v=i6H5XwYnAmA</url>
                    <thumbnail>//i1.ytimg.com/vi/i6H5XwYnAmA/hqdefault.jpg</thumbnail>
                    <driver>YouTube</driver>
                    <protocols>
                        <item>https</item>
                        <item>http</item>
                    </protocols>
                    <error>Error while loading the xml into the document</error>
                </video> 
nitriques commented 10 years ago

Hum that's weird. Could you try to update to the latest dev version again and tell me what do you get in the DS output ?

Also could you try to update to Symphony 2.3.6 ?

Thanks for your patience.

mblabs commented 10 years ago

I didn't updated to 2.3.6 but.... YEAH! It rocks! this is the ds:

            <video id="http-wwwyoutubecom-oembed-format=xml-and-url=http-wwwyoutubecom-watch-v=i6h5xwynama">
                                   <title handle="maria-di-trapani-2013-reality-arrabbiatissima">MARIA di Trapani 2013   Reality   ((( Arrabbiatissima )))))</title>
                                   <url>http://www.youtube.com/watch?v=i6H5XwYnAmA</url>
                                   <thumbnail>//i1.ytimg.com/vi/i6H5XwYnAmA/hqdefault.jpg</thumbnail>
                                   <driver>YouTube</driver>
                                   <protocols>
                                       <item>https</item>
                                       <item>http</item>
                                   </protocols>
                                                   <oembed>
             <author_name>Alberto Lipari</author_name>
             <title>MARIA di Trapani 2013   Reality   ((( Arrabbiatissima )))))</title>
             <height>270</height>
             <provider_name>YouTube</provider_name>
             <thumbnail_width>480</thumbnail_width>
             <html>&lt;iframe width="480" height="270" src="//www.youtube.com/embed/i6H5XwYnAmA?feature=oembed" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;</html>
             <width>480</width>
             <thumbnail_url>//i1.ytimg.com/vi/i6H5XwYnAmA/hqdefault.jpg</thumbnail_url>
             <provider_url>//www.youtube.com/</provider_url>
             <thumbnail_height>360</thumbnail_height>
             <type>video</type>
             <version>1.0</version>
             <author_url>//www.youtube.com/user/STRANUAMURI</author_url>
           </oembed>
           </video>

Thanks for your time nitriques! You are great!

nitriques commented 10 years ago

Woooo. My last change should not have made it work. Basically, I just added a if statement to try and figure out your problem.

If it's working, than great. But this means that the problem was with:

  1. Your xml data in your DB
    OR
  2. Some driver php file were not up to date.

But now if the issue ever comes back, you should see an error message in the DS output instead of crashing the whole site.

Thanks for your time nitriques! You are great!

You're welcome. Reporting issues is really nice for us, so helping you is the least we can do!