Problem/Motivation
Core has experimental Media since 8.x-4: #2831274: Bring Media entity module to core as Media module.
More detailed changes:
https://www.drupal.org/node/2863992
https://www.drupal.org/node/2825215#followup-roadmap
We may have to postpone this for now till Media things are settled enough to work with.
We may need to create a new branch to cope with potentially drastic changes.
Feel free to update issue summary if you are following core Media closely.
Proposed resolution
- Adapt, adjust, and or update to core changes.
- Create a new branch to accommodate changes against 8.x-4.
Remaining tasks
- @todo: List remaining tasks here.
User interface changes
Blazy is mostly dealing with cosmetics, and mostly optional integration, too, there might be none.
API changes
Blazy is mostly dealing with cosmetics, and mostly optional integration, too, there might be none.
Data model changes
Blazy is mostly dealing with cosmetics, and mostly optional integration, too, there might be none.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 2881849-8.patch | 672 bytes | wrd |
Comments
Comment #2
gausarts commentedComment #3
wrd commentedI'm running into the following error in 8.4-rc2:
Fatal error: Call to undefined method Drupal\media\Entity\Media::getType() in /drupal84/docroot/modules/contrib/blazy/src/Dejavu/BlazyVideoTrait.php on line 174
Comment #4
gausarts commentedThank you for the report.
We may need to do a switch for this particular issue to support both Media entity and Media in core at D8.
We can also create a new branch if changes are many. But if one or two, we can do a switch instead.
In your mentioned issue, we simply need to switch
getType()forgetSource().The relavant changes to look for:
https://www.drupal.org/node/2863992
Comment #5
wrd commentedI think I've got it fixed, thanks for the info. I'm not at all sure this is the most efficient way to fix it; if you have an alternate suggestions, let me know. Thanks!
Comment #6
gausarts commentedThanks for the heads up.
Changed to Task to adopt the patch without another thread ;)
I didn't see any change to Field API in regards to
getType()method:https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Field%21F...
vs.
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Field%21F...
Perhaps you can leave Field
getType()things as before. No need to check for agetSource()at field classes.We can focus on things which affect Media entity methods.
The one needs changing seems just this line:
I haven't thoroughly checked this, nor any other thing related to Media changes, though.
Please let me know if you see any issue with your one-liner change only above? Thanks.
Comment #7
wrd commentedAh! Thank you. I'll fix that up and upload a new patch.
Comment #8
wrd commentedOK, here's a new patch. I'll let you know if I run into any more issues. Thanks again for the help!
Comment #9
cbeier commentedYes, I have also only the getType() change found. The blazy module, with the blazy module works fine, with the patch from #8.
Comment #10
Christopher Riley commentedThank you for the patch now I can finally do some testing. Would be nice to see this get committed.
Comment #11
rajab natshahPatch #8 is working.
Thank you.
Comment #12
camilo.escobar commentedPatch #8 works pretty well.
Thanks.
Comment #13
grimreaperHello,
Patch from comment 8 fixed the issue.
Thanks.
Comment #14
imclean commentedThe blazy module seems to have a hard requirement of video_embed_field for media entity views.
blazy.views.incincludes the following:The function
video_embed_media_media_bundle_insert()exists in a sub module of Video Embed Field 1.x, which works with the contrib modulemedia_entity. VEF 2.x works with core's media module but doesn't contain that function.I'm also not sure why
video embed fieldshould be required for media entity views integration if only images are required.Comment #15
imclean commentedWe're being encouraged to use media entities instead of file fields directly. Blazy supports file fields but not entity reference fields for media entities.
For example, a new site wanting a "gallery" field would have an entity reference field to reference media entities. The field widget can be an entity browser with a number of widgets for selecting existing entities or creating new ones.
The "Blazy" display formatter is currently not available for this field.
Edit: An example of how it's being tackled with Photoswipe: #2977943: Support Media and Entity References
Comment #16
seanbMost modules create a new branch to integrate with media in core. This avoids complexity and in the end media_entity contrib is now unsupported.
That is true, however in this case you would configure blazy for you image field in your media type. The node shouldn't have to care about this, which would make it a bit easier I guess?
Comment #17
imclean commentedTrue. As usual there are a number of ways of doing things. Blazy directly supports gallery modules such as Photoswipe and colorbox as well as carousels with the slick media module.
Each media entity could have a single value image field, which makes it easier for entity browsers. The content type then has a multi value entity reference field to the media entity. In this case the gallery/carousel would be within the node while blazy would be used for loading individual images. This could work but would bypass Blazy's support for the gallery style modules.
It also doesn't avoid the problem in #14.
Comment #18
geek-merlinThe issue raised in #14 has its own number: #2997224: Update to support Video Embed Field 8.2.x
The patch there needs review, blink blink.
So re-setting patch in #8 to RTBC due to #11.
Raising prio cause WSOD.
Comment #20
geek-merlinHmm, this issue relly needs some cleanup.
So:
* Retitling for the issue fixed
* If this is the only problem we will NOT need a separate branch (only if the need arises)
* If this is the only problem we will NOT need a plan issue, but will open one if the need arises
* Opened #2999196: Blazy views formatter gone to tackle #14
* Opened #2999198: Roadmap for core Media integration to tackle #15
SO closing this for now.
Comment #21
gausarts commentedThank you!
Comment #23
alisonHi, and thank you!!!!!!!!!! Just verifying, the fact that #8 is included in latest RC, as was #4 over on #2997224: Update to support Video Embed Field 8.2.x, that means Blazy works fine with Media in core, yes...? (checking b/c project page still says otherwise -- which is fine, not blaming you, just checking!)
Sincerely yours,
Overly-anxious person working on a "media in core" upgrade :) :)