Technical blog and writings by Micah Webner.

Blogrimage 2013 Day 6: Default node listing is a view

Today was my second day of trying to build a website on Drupal 8. It gave me a great demonstration of how volatile this release is, and what a challenge this blogrimage will be.

When I sat down to start working on my site this morning, 19 core patches had been applied since the previous day's work. One of these, #1806334: Convert the node listing at /node to Views, represents a pretty significant change to the way that Drupal works. The Views module, an important add-on module for building displays of content, is being moved into Core in Drupal 8, and will eventually replace as many of the built-in displays as possible.

This is great for a lot of reasons, but tricky for my project. Drupal 8 in its current state is really only intended for testing. Changes like this should eventually work fine when upgrading from Drupal 7, but no effort is being made to address how changes like this affect current Drupal 8 installations, because there aren't any. So, for me, this patch means that code for the default display at /node has been removed, but the new view didn't get created because I've already run the site installation process.

Now, my site doesn't even use this display, so it's not really that important, but later changes won't be. (For example, I'm now a little nervous about how unfinished changes like converting nodes and users to the new Entity Field API will affect my data.) But, like N.K.K. might say, keep calm and get back to the TARDIS, so I decided to carry on and figure out how to fix this messy configuration.

Leveraging the new configuration management system

My solution came by leveraging the new Configuration Management system, and I found clues in the testing instructions for #1697256 Create a UI for importing new configuration:

  1. Each site has two directories under sites/default/config_[random_string]. One is named 'active' and one named 'staging'. Copy the configuration from 'active' on the 'dev' site to 'staging' on the 'live' site. You can either copy all of the configuration, or just the files that you have changed.
  2. On the 'live' site, visit 'admin/config/development/sync' and you will see the screen listing your configuration changes. Look at them and see that they represent the changes you made. If so, press 'Import All'. The import will run. Check through the live site to make sure the appropriate changes were in fact made.

Taking my cue from this, I copied the new views.view.frontpage.yml from the node module into the configuration staging directory and ran the import. This worked beautifully to apply the change from the patch.

This seems pretty simple, but it took a lot of time and frustration to figure this out. I don't know if every problem will have similarly clean solutions or not. I just need to keep an eye on the Drupal 8 change notifications and read through the commit log for Drupal core for every update. I found out that there is a Drupal Sprint Weekend happening today and tomorrow, so I expect a deluge of patches to come through in the near future. (Another 16 have landed since I worked on this earlier today.)

In the notes for the sprint weekend, I found this post: Learn Drupal 8 now by helping to make it more unified and user/developer friendly by Gábor Hojtsy. It touches on a lot of things I need to learn about for this project.

Backup and Migrate

Today's story doesn't end there. I decided that with all of these challenges, I'd better make sure my site is getting backed up correctly. For most sites, I do multiple backups, both with Drush and with the Backup and Migrate module.

Drush really isn't ready for Drupal 8 yet. I upgraded to the 8.x-6.x-dev branch and found that the backup isn't really working. I also ran into an issue with modules not being downloaded to the correct directories.

Once I got Backup and Migrate installed, I knew I'd have to deal with an issue to rename the .info file to .info.yml, but the available patch did not apply cleanly. I ended up submitting an updated patch for that one, but I really didn't fix anything significant. My bigger impediment was finding a new bug related to file system settings. I had time to submit a bug report, but no time to look for a solution.

All in all it was a pretty rough session. Time constraints made me walk away from it earlier and not get back to blog about it until late, but I do feel like I've accomplished some things today. Here's hoping that tomorrow's work goes a little smoother.