Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update embed/embed to v4 for support with newer plugins #140

Merged
merged 5 commits into from
Nov 8, 2023

Conversation

reganlawton
Copy link
Member

composer.json:

  • Update embed/embed version to v4.4

FallbackAdapter.php:

  • Replace Adapter class with EmbedAdapter class
  • Remove init() function
  • Remove getCode() function
  • Inherit from new EmbedAdapter class

OembedService.php:

  • Replace Adapter class with EmbedAdapter class
  • Replace Utils class with wrav\oembed\adapters\EmbedAdapter class
  • Modify getOEmbed() to use Embed class for fetching oembed data
  • Modify create() to initialize EmbedAdapter with oembed data

composer.json:
- Update embed/embed version to v4.4

FallbackAdapter.php:
- Replace Adapter class with EmbedAdapter class
- Remove init() function
- Remove getCode() function
- Inherit from new EmbedAdapter class

OembedService.php:
- Replace Adapter class with EmbedAdapter class
- Replace Utils class with wrav\oembed\adapters\EmbedAdapter class
- Modify getOEmbed() to use Embed class for fetching oembed data
- Modify create() to initialize EmbedAdapter with oembed data
@reganlawton reganlawton linked an issue Nov 3, 2023 that may be closed by this pull request
@reganlawton reganlawton self-assigned this Nov 3, 2023
@reganlawton reganlawton added this to the 3.0.0 milestone Nov 3, 2023
@reganlawton
Copy link
Member Author

My issue with this upgrade will be the support with GraphQL.

@sgtpenguin would be nice is you could test this release using dev-feature/embed-v4 composer tag as I know you have a GQL project

@sgtpenguin
Copy link
Contributor

I briefly tested it out and it looks like it works except it errors when the field is empty again. The fix before involved setting the width and height to null when the field is empty in the FallbackAdapter. FallbackAdaper is different now but maybe there's a way to solve for it. The error I see now is:

"debugMessage": "Undefined variable $media",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "file": "/var/www/html/vendor/wrav/oembed/src/services/OembedService.php",
      "line": 222,

@reganlawton
Copy link
Member Author

@sgtpenguin thank you so many for your time reviewing the PR. I'll get on those changes 🙏

@sgtpenguin
Copy link
Contributor

No problem. Let me know if I can be of any more assistance. Thank you for your work on this plugin.

@reganlawton
Copy link
Member Author

@sgtpenguin It seems to be working for me for me. That said your GQL might be more complex

Screenshot 2023-11-06 at 7 31 20 am

And if I have a NULL field complete, after I made a few changes please update to latest changes.

Screenshot 2023-11-06 at 7 47 00 am

@reganlawton
Copy link
Member Author

@sgtpenguin I believe the error you were getting work caused when you have a NULL variable. The fix that I commit to the branch is probably the cause and has been cause of a typo 😅

@sgtpenguin
Copy link
Contributor

@reganlawton Awesome - It works great now. Nice job!

@reganlawton reganlawton merged commit 273ed21 into master Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I think you're going to have to upgrade to oembed 4 soon
2 participants