Xdebug with Vim for Docker for Mac with Ubuntu 16.04

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.

Web development with Docker and Drupal on OS X

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.

Radio Buttons in Swift without NSMatrix

Radio Buttons using NSMatrix has been deprecated and information on how to use Radio Buttons without NSMatrix is difficult to find. So this is documentation of a way to use the new Radios Buttons using Xcode 7.2.1 and Swift 2.1.1.

Create a new Xcode project and choose Cocoa Application under OS X Application. Call it Radio Buttons and check Swift. Do not check Use Storyboards, Create Document-Based Application or Use Core Data.

Where has basePath gone in Drupal 8?

Javascript code in Drupal 7 used drupal_add_js() to attach Javascript code to a webpage.  The Javascript code then used Drupal.settings.basePath to prepend the path to the Drupal installation.  For Drupal installed in the root directory, Drupal.settings.basePath is just the string '/' but if Drupal is installed in a subdirectory then this is necessary for the Javascript code to continue to work.  The php part is

drupal_add_js(drupal_get_path('module', 'mymodule') . '/mymodule.js');

and the Javascript part is

Create a node programmatically in Drupal 8

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.

Fuzzy autocomplete

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.

Understanding the node processor plugin for the Feeds module

In Drupal 6, the Feeds module has three types of plugins.  These are the fetcher, parser and the processor plugins.  The processor plugins that are supplied with the Feeds module are for data, nodes, taxonomy and users.  This article looks at the node processor.

If a feed is imported multiple times to allow the information in the feed to update the Drupal site, thre are three options under the node processor settings.  These are

Ordering Drupal hooks and callbacks

A while ago someone was testing me on my Drupal knowledge.  He inquired which hook gets called first, hook_form_alter() or hook_form_FORM_ID_alter().  I was a bit puzzled since nothing in the system api specifies that one is called first and wondered why he was not using other approaches that are in the api.  Hook_form_FORM_ID_alter() he crowed triumphantly.  I thought it strange to rely on the order of calling these two hooks since there is nothing that guarantees that the order will always be the same.  In fact, his claim is only true for Drupal 6.  The order