[Week 2] More media bundles and tests

Hello all!

So the second week of GSoC ends. As mentioned in the introduction post, I was working on the media module for Drupal 8 with Janez Urevc (​slashrsm) and Tadej Baša (​paranojik). We decided to finish media bundles for video and slideshow first before moving on to the file browser.

Last week we finished the image media bundle, so similar kind of work had to be done for video and slideshow.

I included default configuration files for video and wrote tests to check if the bundle is being created or not. But strangely the tests on Travis CI were failing. Our .travis.yml file is using drupal_ti which uses drush to install modules. Since video_embed_media is a dependency of our media module, drush was trying to search for the module and was failing to find it. The reason was video_embed_media is a submodule of video_embed_field which needs to enabled first and then video_embed_media can be enabled. So the solution was simple, I just had to add a custom script in before_script section of travis.yml file to enable the modules in the right sequence.

Another problem which I faced was that whenever I tried to create a video media bundle by importing config files, it automatically created a video field for it. So we had two fields for the Video URL. I wrote a patch for this Video_embed_field module which checked if the module already had a source field and not create another field in case it already has. You can see the patch, which has been committed, here.

I also worked on a patch for Media entity module which disabled editing of the machine name of media bundles while editing the bundle. The machine name cannot be edited once the bundle has been created. So it was important to disable the edit functionality. You can see the patch here.

The entire pull request is on github.

This week I also started work on the media browser. It still needs a lot of work so I’ll continue with that this week.

Have an amazing week and I’ll post more updates next week!

:)

 
4
Kudos
 
4
Kudos

Now read this

[Week 12] Finishing the crop functionality and improving UI

Hello everyone! You must have read about the media module on which I was working with Janez Urevc (slashrsm) and Tadej Baša (paranojik) under Google Summer of Code 2016. According to the timeline, this is the final week of the project... Continue →