User login

done

Format code blocks within bulletted lists with ReStructured Text (rst)

The trick is to use the double-colon (::) at the end of the text where you want to introduce the code block with a single colon, and then indent the code block four spaces while only indenting the regular text two spaces. Do this even though you want the non-code lines of text to visually appear at the same indent as the code block and the original introducing line of the bullet.

The following ReStructured Text (ReST) markup, typically put in a .rst file, for example:

Solving a newly installed application not running on Debian when you vaguely recall the app is Python

I'm using Debian Mint but all of this should also apply for Ubuntu and maybe even Mac OS X.

In my case i was installing QTodoTxt but the same debugging, and potentially solution, should apply to any application. They had a .deb package which i used to install it, and i was delighted— I wouldn't have to worry about handling dependencies myself. Indeed, it installed successfully and showed up with a nice icon in my application launcher. And launching it... did nothing.

Removing double spaces in usernames directly in the SQL

A client using the Bulk invite module (by Agaric's David Valdez) had invited hundreds of users with slightly malformed usernames— two spaces between first and last name when there should only be one.

Note that you need to do the change both in the users_field_data table and the users_field_revision table— and you need to clear caches when you're done to see the change on user edit pages, which is where it matters.

Replacing the Druplicon favicon in a custom theme for Drupal 8

Placing the favicon.ico in the root of the theme folder, presuming you are using a custom theme, is by far the easiest way to tell Drupal to use that favicon.ico file in the rel shortcut icon (favicon) tag— and so displayed by modern browsers in the tab bar.

How to install Riot desktop (Matrix client) on Debian-based systems

Tested on Debian Mint edition, but this should work for Ubuntu too.

These instructions assume you are willing and able to use the command line— that is, open a terminal and type these lines of commands. Unlike the the official desktop install information, these instructions don't assume you already know and remember how to add a new remote source to your package manager and install from it.

The saga of Drupal link-link

Are your builds failing because of this?

Easily add content with update hooks: use default content module exports to create content that needs to be in sync with configuration

An approach for keeping content that is added as part of development synchronized with test and production environments is to use the Default Content module to export the content. It's built for the content to be exported to an installation profile's 'content' folder, and then the module, if enabled, automatically brings the content in when the site is installed.

Argument 2 passed to hook help() must be an instance of RouteMatchInterface

I got this error message, that argument two passed to my module's implementation of hook_help() "must be an instance of RouteMatchInterface, instance of Drupal\Core\Routing\CurrentRouteMatch given", and it's a misleading one.

CurrentRouteMatch in fact (unsurprisingly) implements the RouteMatchInterface. The problem was i hadn't actually defined CurrentRouteMatch— i needed to have a use statement at the top of my module (or use the full PSR4 path in the parameter definition of the hook implementation, but i went with the former). Like so:

How to get the base path for your Drupal 8 site in a Twig template

In page.html.twig you will have a working {{ base_path }} variable. Why it isn't available in every template, i have no idea. As i think it should be and everything else looks messy, my preferred solution is to do exactly as Drupal does in the preprocess page function for any place i need it.

Syndicate content