I'm doing a manual migration from a D7 site to a D8 site, and am using Migrate CSV Source to facilitate it. As such, I loaded all of the video URLs into the spreadsheet. I'm able to import all of the values into the field_my_embed_filed_value column and they show up in my nodes. However, shortly thereafter an error show up all over my site and causes some things to stop working.
Among other things, I cannot change the field formatter on my node display due to an ajax error and the following error:
"Fatal error: Call to a member function renderEmbedCode() on a non-object in /Users/mrweiner/Sites/devdesktop/jakesfireworks4-dev/docroot/modules/video_embed_field/src/Plugin/Field/FieldFormatter/Video.php on line 51".
Any Idea what's going on? I'm completely lost.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 2828719-missing-providers-15.patch | 6.14 KB | sam152 |
| #11 | fail_gracefully_when_a-2828719-11.patch | 1.61 KB | mirom |
Comments
Comment #2
mrweiner commentedComment #3
sam152 commentedI wonder if there is an embed provider to match your input? What is the Video URL if you don't mind me asking?
Comment #4
sam152 commentedComment #5
sam152 commentedCan I nudge you on this? I'd like to look at making the module handle this better even if you've resolved the issue for your use case?
Comment #6
mrweiner commentedThanks for the nudge. Got distracted with other aspects of development so I've just had the tables truncated to avoid the issue. I imported ~700 nodes, so there's not just a single URL that is/was the problem. However, I re-imported all of the Video URLs a bit ago and the error popped back up, so I started investigating the database. The urls are all either wistia or youtube urls, and I've got the wistia support module enabled, so all providers are supported.
It does look like a handful of the urls were malformed, though. The proper URL for the wistia videos is, let's say, https://myaccount.wistia.com/medias/xxxxxx. Some of the urls were formatted instead as:
I'm assuming that these must have been the problem entries. I just went through and remedied all of these manually, so I'm hoping that this knocks out the error. While the error hasn't come back yet, it's hard to say for sure if this solved it since it seemed to crop up randomly and then not go away until the tables were truncated.
I'll post an update back here when I (think I) know more.
Comment #7
mrweiner commentedHaven't had the error pop back up since updating those rows, so I'm hoping that that actually ended up taking care of it.
Comment #8
sam152 commentedComment #9
mrweiner commentedIt would be great if the failure could include a notice of which node(s) is/are the culprit(s).
Comment #10
sam152 commentedComment #11
mirom commentedHi, I reached this problem as well in relation to migration.In my case I had to extract video resources from html and it's quite hard to normalise all of them. Attached patch is working fine for me.
Comment #12
sam152 commentedThanks for working on this.
I wonder if this is sensitive to other contexts like the media entity integration and WYSWIYG embeds. The logging is interesting, although might fill up the logs. Perhaps a message in the output or something visual to indicate a video should be rendered but the value is invalid? In any case this would require some tests.
Comment #13
mirom commentedI checked media and wysiwyg integrations and it seems to be covered there. I'll try to write some tests.
Comment #14
kasperg commentedI ended up in the same situation as other commenters in regard to migration. The patch in #11 works for me.
I could image you could end up in a similar situation if you use a module with a VideoEmbedProvider plugin, create some content which uses that provider and then uninstall the plugin.
In general
Drupal\video_embed_field\Plugin\Field\FieldFormatter\Videocalls\Drupal\video_embed_field\ProviderManagerInterface->loadProviderFromInput()but does not take the declared boolean return value into account. The patch in #11 fixes that.Comment #15
sam152 commentedAdded tests and displayed a message in the field output when providers were missing.
Comment #16
lpeabody commentedShould't this be a critical bug report given that a fatal error will kill the request?
Comment #17
sam152 commentedYou can't really trigger this by installing the module and creating content, but it's probably the only open bug against 8.x so doesn't really matter what the priority is set to.
Comment #18
sam152 commentedAdding credit to lpeabody based on work in #2842820: Fatal error: Call to a member function renderEmbedCode() on boolean.
Comment #19
sam152 commented