Coder Social home page Coder Social logo

Comments (9)

reganlawton avatar reganlawton commented on July 27, 2024 1

I'll have to look into this I've been smashed lately when investor deadlines but have a few tweaks needing to be done to the application

from oembed.

reganlawton avatar reganlawton commented on July 27, 2024

@iparr I believe this is 100% valid. I’ll make it do errors only display in DEV via the twig variable output.

In anything other I’ll just error to log file.

from oembed.

reganlawton avatar reganlawton commented on July 27, 2024

@iparr I've finally got a chances to push changes to the plugin I made this morning tagged v1.1.3.

It comes with better sub prop handling, if the property is missing, as well as a new valid methods as a TWIG variable and new method on the field. See README for more information.

from oembed.

iparr avatar iparr commented on July 27, 2024

I've tested this and it's allowed me check for valid oEmbeds in a much nicer way. Thanks! Great work.

from oembed.

reganlawton avatar reganlawton commented on July 27, 2024

Thanks for the issue report and glad it’s working for you now. 👍

from oembed.

iparr avatar iparr commented on July 27, 2024

Hey, I think this has regressed or alternatively I've misunderstood something.

I have invalid fields that I'd like to test for in Twig.

I'm using:

{% block.embed.valid %}
…

or {{ block.embedId.valid }} or {% if craft.oembed.valid(block.embedId.valid) %}… and both still result in errors.

So how is best to test for valid fields on the front-end?

from oembed.

iparr avatar iparr commented on July 27, 2024

I would like this re-opened if possible @reganlawton

I'm still not sure how to test for embeds that are invalid.

For example, when a URL like this https://thesludgelord.bandcamp.com/album/metal is rendered invalid because an owner removes it, then my website breaks with a Caused by: Embed\Exceptions\InvalidUrlException error.

How is best to combat this?

from oembed.

reganlawton avatar reganlawton commented on July 27, 2024

@iparr I have updated the handling a bit better if you want to take a look at this in the latest v1.3.9

from oembed.

iparr avatar iparr commented on July 27, 2024

Sorry, if I use it with the same example as above, I still get:

Serialization of 'class@anonymous' is not allowed
↵
Caused by: Embed\Exceptions\InvalidUrlException
Invalid url 'https://thesludgelord.bandcamp.com/album/metal' (Status code 404)

from oembed.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.