Part 1 looked at how to put the source database credentials in settings.php. Part 2 looks at how to specify the source website root so that files are properly transferred. After the fix for the database settings in part 1 the command for configuring the migration is
drush migrate-upgrade --legacy-root=http://mydrupal7site.com --configure-only
The import of the files is done by running
Suppose that the information to be displayed comes from two different views that somehow needs to be joined. In SQL this can be done using a "UNION' but Views does not have such a construct. But it does not take a lot of code to achieve this in Drupal 8.
Drupal 8 forms are usually classes that inherit from the FormBase class. The FormBase class provides underlying functionality such as AJAX for Drupal forms. This article explores how to use only the form API without the FormBase class yet provide a light weight AJAX behavior. To keep this from getting too complex only buttons and event handling are considered. While this could be useful on its own it also prov
Integrated Development Environments (IDEs) are nice for debugging problems but with Docker containers they have to be set up to work remotely. Vim may not be as nice an interface but has an advantage of being able to run in the container making it easier to get set up and running quickly. This is especially true for new releases where there is not much information yet on configuration.
Docker has just been released for Mac OS X and it takes a different approach of using containers. It claims to be faster and quicker to set up then alternatives such as virtual machines. I will look at using Docker to set up a basic local development environment for a Drupal 8 website on Ubuntu 16.04. I will be using PHP 7.0 and MariaDB. This is done for an actual website and some problems are encountered which will demonstrate how to debug and the tools that can be used to solve issues.
drupal_add_js(drupal_get_path('module', 'mymodule') . '/mymodule.js');
Many of the changes from Drupal 7 to Drupal 8 involve the use of object oriented code. One particular change is to move away from code specific to nodes to writing the code for entities and then overriding or extending it where necessary for nodes. Conceptually, this results in being able to use much of the same code for other entities including custom entities.
For a small number of taxonomy terms, a select box can be used where the choices are explicitly displayed to the user. But for larger numbers of terms using a select box becomes problematic. Using a textfield with autocomplete is an obvious option when there are a large number of terms but it can be discarded because it is not robust to variations in spelling. This post shows how in Drupal 7 a fuzzy autocomplete can be used to increase robustness.