Coder Social home page Coder Social logo

Comments (11)

reganlawton avatar reganlawton commented on July 27, 2024 1

@nitech I'm gonna look into this issue as I also run a multi-sites with the plugin and haven't come the issue yet but currently in the process of a migration to CraftCMS v3.2, which the issue might be happening.

from oembed.

nitech avatar nitech commented on July 27, 2024

It might have something to do with multisite. My Craft install has 4 sites. When I changed the field type from oEmbed to Plain Text, this is what the plain text contained: {"url":{"url":{"url":{"url":"https://www.youtube.com/watch?v=RvvF1BQyUHs"}}}}

Seems to me that the json is wrapped inside itself four times. However, when I have a look at the content table, I even find oEmbed fields wrapped 5 times in themselves.

from oembed.

nitech avatar nitech commented on July 27, 2024

When I manually fix the json-data in the database, this "wrapping" happens again immediately when I try to change propagation method on the said section.

I ended up changing oEmbed to a Plain Text field and fixing the data back to plain text by running the following SQLs

-- Detect wraps
SELECT field_videoUrl FROM customer_automasjon_craft.content  
where field_videoUrl like '{\"url\":{\"url\"%';

-- Remove 2x (just run this as many times as you believe you have duplicates/wraps)
update content set field_videoUrl = replace(field_videoUrl, '{\"url\":{\"url\":', '{\"url\":') 
where field_videoUrl like '{\"url\":{\"url\"%';
update content set field_videoUrl = replace(field_videoUrl, '}}', '}') 
where field_videoUrl like '%}}';

-- Convert all oEmbeds to plain text
update content set field_videoUrl = replace(field_videoUrl, '{\"url\":\"', '') 
where field_videoUrl like '{\"url\":%';
update content set field_videoUrl = replace(field_videoUrl, '\"}', '') 
where field_videoUrl like '%}';

After I had converted the fields to plaintext and removed traces of the JSON-wrapping, the queued jobs went green.

So this is a fix to make due without the oEmbed-field while we wait for a fix to the bug.

from oembed.

reganlawton avatar reganlawton commented on July 27, 2024

@nitech I think this is an issue with the normalizeValue in the field. I might need to support recursion here.

from oembed.

reganlawton avatar reganlawton commented on July 27, 2024

@nitech can you try checking out the feature/recursive-bug branch in composer, using dev-feature/recursive-bug tag, to see if thats fixing the 5th+ level JSON values from not being converted. That should prevent the issue and stop the queue job failing.

If not let me know and I'll keep on it for you.

from oembed.

nitech avatar nitech commented on July 27, 2024

Thanks @reganlawton . I will check it when I have the possibility. Right now I am deep into another problem that occurred when upgrading Craft CMS to 3.2 (neo-field duplicated content problem at spicywebau/craft-neo#242)

When I have that sorted out, I will test oEmbed at the mentioned branch.

You asked about an URL for the site - but I see you've removed the question from your comment. Just tell me if you need anything more.

In the meanwhile, while I work on the issue with the Neo-field - If it helps you, I can give you a copy of the database. Just give me an email and it'll be on it's way.

from oembed.

reganlawton avatar reganlawton commented on July 27, 2024

I missed the Link in the above messages so amended my question. The note that you had 5 level deep objects kinda stood out and was I issue I believed I’d patched but must never had pushed. It also explains the array to string issue.

So I’m hoping the recursive function being, well recursive, should resolve it. I also have additional work for CraftCMS 3.2 future version coming that’ll add Unit Testing to the plugin which should help cover these issues in the future.

from oembed.

reganlawton avatar reganlawton commented on July 27, 2024

@nitech Any luck testing this?

from oembed.

reganlawton avatar reganlawton commented on July 27, 2024

Deployed fix in v1.1.8

from oembed.

nitech avatar nitech commented on July 27, 2024

Sorry that I did not get to try it before you deployed. Great work Regan :-)

from oembed.

reganlawton avatar reganlawton commented on July 27, 2024

Did it resolve your error?

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.